govuk_publishing_components 23.11.0 → 23.12.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/analytics/external-link-tracker.js +0 -2
- data/app/assets/javascripts/govuk_publishing_components/analytics/pii.js +29 -1
- data/app/assets/javascripts/govuk_publishing_components/components/header.js +3 -0
- data/app/assets/javascripts/govuk_publishing_components/components/layout-header.js +5 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +66 -14
- data/app/assets/javascripts/govuk_publishing_components/modules.js +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +5 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_show-password.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +17 -6
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +5 -0
- data/app/controllers/govuk_publishing_components/audit_controller.rb +3 -0
- data/app/models/govuk_publishing_components/audit_applications.rb +12 -5
- data/app/models/govuk_publishing_components/audit_comparer.rb +12 -0
- data/app/views/govuk_publishing_components/audit/show.html.erb +15 -0
- data/app/views/govuk_publishing_components/components/_button.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +3 -2
- data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +3 -0
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +82 -0
- data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +3 -0
- data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +30 -0
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +21 -0
- data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +3 -0
- data/app/views/govuk_publishing_components/components/docs/subscription_links.yml +100 -0
- data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +3 -1
- data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +137 -0
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +3 -3
- data/config/locales/cy.yml +1 -1
- data/config/locales/en.yml +1 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +7 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_transition-countdown.scss +0 -125
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0836916950b2ba5523342245a89390195dbc6687424656f229384afc5d079313'
|
4
|
+
data.tar.gz: 838a58d52afa6587637a377cee6a68077b6eb8ff1fecb2edfe820775943e4be9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c04d9f5166eb2689a04e4b2307404d2f9e8c8aeeb419fd48d102351532b3c361e002b8e31b7901763eba35ff0ceb38bcf14db3042ef6757d7072ce4e6fd9d7c2
|
7
|
+
data.tar.gz: 89cb76ebcb46366ffb1197e6031115d527ce40ae2eaf30301b8f6985df197875b34d4545e41512f9f789b1f7107f9beac28fc1a716be51990f8eacb9959dbed4
|
@@ -10,7 +10,6 @@
|
|
10
10
|
var externalLinkUploadCustomDimension = options.externalLinkUploadCustomDimension
|
11
11
|
var currentHost = GOVUK.analyticsPlugins.externalLinkTracker.getHostname()
|
12
12
|
var externalLinkSelector = 'a[href^="http"]:not(a[href*="' + currentHost + '"])'
|
13
|
-
|
14
13
|
$('body').on('click', externalLinkSelector, trackClickEvent)
|
15
14
|
|
16
15
|
function trackClickEvent (evt) {
|
@@ -33,7 +32,6 @@
|
|
33
32
|
|
34
33
|
GOVUK.analytics.setDimension(externalLinkUploadCustomDimension, externalLinkToJoinUploadOn)
|
35
34
|
}
|
36
|
-
|
37
35
|
GOVUK.analytics.trackEvent('External Link Clicked', href, options)
|
38
36
|
}
|
39
37
|
|
@@ -5,8 +5,9 @@
|
|
5
5
|
|
6
6
|
var GOVUK = global.GOVUK || {}
|
7
7
|
var EMAIL_PATTERN = /[^\s=/?&]+(?:@|%40)[^\s=/?&]+/g
|
8
|
-
var POSTCODE_PATTERN = /[A-PR-UWYZ][A-HJ-Z]?[0-9][0-9A-HJKMNPR-Y]?(?:[\s+]|%20)*[0-9][ABD-HJLNPQ-Z]{2}/gi
|
8
|
+
var POSTCODE_PATTERN = /[A-PR-UWYZ][A-HJ-Z]?[0-9][0-9A-HJKMNPR-Y]?(?:[\s+]|%20)*[0-9](?!refund)[ABD-HJLNPQ-Z]{2,3}/gi
|
9
9
|
var DATE_PATTERN = /\d{4}(-?)\d{2}(-?)\d{2}/g
|
10
|
+
var ESCAPE_REGEX_PATTERN = /[|\\{}()[\]^$+*?.]/g
|
10
11
|
|
11
12
|
// specific URL parameters to be redacted from accounts URLs
|
12
13
|
var RESET_PASSWORD_TOKEN_PATTERN = /reset_password_token=[a-zA-Z0-9-]+/g
|
@@ -21,9 +22,24 @@
|
|
21
22
|
return ($('meta[name="govuk:static-analytics:strip-postcodes"]').length > 0)
|
22
23
|
}
|
23
24
|
|
25
|
+
function queryStringParametersToStrip () {
|
26
|
+
var value = $('meta[name="govuk:static-analytics:strip-query-string-parameters"]').attr('content')
|
27
|
+
var parameters = []
|
28
|
+
|
29
|
+
if (value) {
|
30
|
+
var split = value.split(',')
|
31
|
+
for (var i = 0; i < split.length; i++) {
|
32
|
+
parameters.push(split[i].trim())
|
33
|
+
}
|
34
|
+
}
|
35
|
+
|
36
|
+
return parameters
|
37
|
+
}
|
38
|
+
|
24
39
|
var pii = function () {
|
25
40
|
this.stripDatePII = shouldStripDates()
|
26
41
|
this.stripPostcodePII = shouldStripPostcodes()
|
42
|
+
this.queryStringParametersToStrip = queryStringParametersToStrip()
|
27
43
|
}
|
28
44
|
|
29
45
|
pii.prototype.stripPII = function (value) {
|
@@ -43,6 +59,7 @@
|
|
43
59
|
stripped = stripped.replace(RESET_PASSWORD_TOKEN_PATTERN, 'reset_password_token=[reset_password_token]')
|
44
60
|
stripped = stripped.replace(UNLOCK_TOKEN_PATTERN, 'unlock_token=[unlock_token]')
|
45
61
|
stripped = stripped.replace(STATE_PATTERN, 'state=[state]')
|
62
|
+
stripped = this.stripQueryStringParameters(stripped)
|
46
63
|
|
47
64
|
if (this.stripDatePII === true) {
|
48
65
|
stripped = stripped.replace(DATE_PATTERN, '[date]')
|
@@ -77,6 +94,17 @@
|
|
77
94
|
return array
|
78
95
|
}
|
79
96
|
|
97
|
+
pii.prototype.stripQueryStringParameters = function (string) {
|
98
|
+
for (var i = 0; i < this.queryStringParametersToStrip.length; i++) {
|
99
|
+
var parameter = this.queryStringParametersToStrip[i]
|
100
|
+
var escaped = parameter.replace(ESCAPE_REGEX_PATTERN, '\\$&')
|
101
|
+
var regexp = new RegExp('((?:\\?|&)' + escaped + '=)(?:[^&#\\s]*)', 'g')
|
102
|
+
string = string.replace(regexp, '$1[' + parameter + ']')
|
103
|
+
}
|
104
|
+
|
105
|
+
return string
|
106
|
+
}
|
107
|
+
|
80
108
|
GOVUK.Pii = pii
|
81
109
|
|
82
110
|
global.GOVUK = GOVUK
|
@@ -11,9 +11,12 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
11
11
|
this.options = {
|
12
12
|
outOf: 65,
|
13
13
|
applyOnInit: true,
|
14
|
-
toggleText: 'Toggle between chart and table',
|
15
14
|
autoOutdent: false,
|
16
15
|
outdentAll: false,
|
16
|
+
chartVisibleText: 'Change to table and accessible view',
|
17
|
+
tableVisibleText: 'Change to chart view',
|
18
|
+
chartAlertText: 'Chart visible',
|
19
|
+
tableAlertText: 'Table visible',
|
17
20
|
toggleAfter: false, // BOOL set TRUE to append the toggle link
|
18
21
|
returnReference: false // for testing purposes
|
19
22
|
}
|
@@ -27,6 +30,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
27
30
|
// store a reference to the table in the object
|
28
31
|
this.$table = $module
|
29
32
|
|
33
|
+
// a container around the graph element so that it can be targeted by screen readers, allowing us to inform screen reader users that the graph isn't accessible
|
34
|
+
this.$graphContainer = document.createElement('div')
|
35
|
+
this.$graphContainer.className = 'mc-chart-container'
|
36
|
+
|
30
37
|
// lets make what will become the new graph
|
31
38
|
this.$graph = document.createElement('div')
|
32
39
|
|
@@ -39,6 +46,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
39
46
|
this.$graph.setAttribute('class', this.$table.className)
|
40
47
|
this.$graph.classList.add('mc-chart')
|
41
48
|
|
49
|
+
// get the id of the current chart within the page so that it can be used during the generation of the toggleLink
|
50
|
+
this.chartId = this.getChartId($module)
|
51
|
+
|
42
52
|
// set the stacked option based on
|
43
53
|
// giving the table a class of mc-stacked
|
44
54
|
this.options.stacked = this.$table.classList.contains('mc-stacked')
|
@@ -102,7 +112,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
102
112
|
this.addClassesToHeader()
|
103
113
|
this.applyWidths()
|
104
114
|
this.insert()
|
105
|
-
this.$table.classList.add('
|
115
|
+
this.$table.classList.add('mc-hidden')
|
106
116
|
this.applyOutdent()
|
107
117
|
}
|
108
118
|
}
|
@@ -164,24 +174,42 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
164
174
|
}
|
165
175
|
|
166
176
|
// construct a link to allow the user to toggle between chart and table
|
167
|
-
MagnaCharta.prototype.construct.toggleLink = function (
|
168
|
-
var link = document.createElement('
|
169
|
-
|
170
|
-
|
171
|
-
link
|
172
|
-
|
177
|
+
MagnaCharta.prototype.construct.toggleLink = function (chartVisibleText) {
|
178
|
+
var link = document.createElement('button')
|
179
|
+
|
180
|
+
// These spans are for managing the content within the button
|
181
|
+
// toggleText is the public facing content whilst toggleStatus is visually hidden content that we use to let screen reader users know that the toggle link has been clicked
|
182
|
+
var toggleText = document.createElement('span')
|
183
|
+
var toggleStatus = document.createElement('span')
|
184
|
+
|
185
|
+
toggleText.classList.add('mc-toggle-text')
|
186
|
+
toggleText.innerHTML = chartVisibleText
|
187
|
+
|
188
|
+
toggleStatus.classList.add('govuk-visually-hidden', 'mc-toggle-status')
|
189
|
+
toggleStatus.setAttribute('role', 'alert')
|
190
|
+
|
191
|
+
link.classList.add('mc-toggle-button')
|
192
|
+
link.appendChild(toggleText)
|
193
|
+
link.appendChild(toggleStatus)
|
173
194
|
|
174
195
|
return link
|
175
196
|
}
|
176
197
|
|
177
198
|
// toggles between showing the table and showing the chart
|
178
|
-
MagnaCharta.prototype.addToggleClick = function () {
|
199
|
+
MagnaCharta.prototype.addToggleClick = function (chartVisible, tableVisible, chartAlert, tableAlert) {
|
179
200
|
var that = this
|
180
201
|
|
181
202
|
this.toggleLink.addEventListener('click', function (e) {
|
182
203
|
e.preventDefault()
|
183
|
-
|
184
|
-
that
|
204
|
+
|
205
|
+
var toggleText = that.toggleLink.querySelector('.mc-toggle-text')
|
206
|
+
var toggleStatus = that.toggleLink.querySelector('.mc-toggle-status')
|
207
|
+
|
208
|
+
that.$graphContainer.classList.toggle('mc-hidden')
|
209
|
+
that.$table.classList.toggle('mc-hidden')
|
210
|
+
|
211
|
+
toggleText.innerHTML = toggleText.innerHTML === tableVisible ? chartVisible : tableVisible
|
212
|
+
toggleStatus.innerHTML = toggleStatus.innerHTML === tableAlert ? chartAlert : tableAlert
|
185
213
|
})
|
186
214
|
}
|
187
215
|
|
@@ -191,8 +219,8 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
191
219
|
// get at options and properties
|
192
220
|
var thead = this.construct.thead.call(this)
|
193
221
|
var tbody = this.construct.tbody.call(this)
|
194
|
-
this.toggleLink = this.construct.toggleLink(this.options.
|
195
|
-
this.addToggleClick(this.
|
222
|
+
this.toggleLink = this.construct.toggleLink(this.options.chartVisibleText)
|
223
|
+
this.addToggleClick(this.options.chartVisibleText, this.options.tableVisibleText, this.options.chartAlertText, this.options.tableAlertText)
|
196
224
|
|
197
225
|
if (this.options.hasCaption) {
|
198
226
|
var caption = this.construct.caption.call(this)
|
@@ -379,7 +407,18 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
379
407
|
}
|
380
408
|
|
381
409
|
MagnaCharta.prototype.insert = function () {
|
382
|
-
|
410
|
+
var label = document.createElement('span')
|
411
|
+
var labelId = 'mc-chart-not-accessible-' + this.chartId
|
412
|
+
|
413
|
+
label.innerHTML = 'This content is not accessible - switch to table'
|
414
|
+
label.className = 'mc-hidden'
|
415
|
+
label.id = labelId
|
416
|
+
|
417
|
+
this.$graphContainer.setAttribute('aria-labelledby', labelId)
|
418
|
+
this.$graphContainer.appendChild(this.$graph)
|
419
|
+
this.$graphContainer.appendChild(label)
|
420
|
+
|
421
|
+
this.$table.insertAdjacentElement('afterend', this.$graphContainer)
|
383
422
|
}
|
384
423
|
|
385
424
|
MagnaCharta.prototype.applyOutdent = function () {
|
@@ -419,5 +458,18 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
419
458
|
}
|
420
459
|
}
|
421
460
|
|
461
|
+
MagnaCharta.prototype.getChartId = function (module) {
|
462
|
+
var allCharts = document.querySelectorAll('table.js-barchart-table')
|
463
|
+
var id = null
|
464
|
+
|
465
|
+
allCharts.forEach(function (chart, i) {
|
466
|
+
if (chart === module) {
|
467
|
+
id = i
|
468
|
+
}
|
469
|
+
})
|
470
|
+
|
471
|
+
return id
|
472
|
+
}
|
473
|
+
|
422
474
|
Modules.MagnaCharta = MagnaCharta
|
423
475
|
})(window.GOVUK.Modules)
|
@@ -270,15 +270,26 @@
|
|
270
270
|
text-align: left;
|
271
271
|
}
|
272
272
|
|
273
|
-
.mc-toggle-
|
274
|
-
|
275
|
-
|
273
|
+
.mc-toggle-button {
|
274
|
+
@extend %govuk-body-s;
|
275
|
+
border: 1px solid $govuk-border-colour;
|
276
|
+
color: $govuk-link-colour;
|
277
|
+
cursor: pointer;
|
278
|
+
margin: govuk-spacing(0);
|
279
|
+
padding: govuk-spacing(2);
|
280
|
+
background-color: govuk-colour("white");
|
281
|
+
|
282
|
+
&:focus {
|
283
|
+
@include govuk-focused-text;
|
284
|
+
background-color: $govuk-focus-colour;
|
285
|
+
border-color: transparent;
|
286
|
+
}
|
276
287
|
}
|
277
288
|
|
278
289
|
// Hides the original table
|
279
|
-
.
|
280
|
-
.
|
281
|
-
|
290
|
+
.mc-hidden,
|
291
|
+
.mc-hidden caption {
|
292
|
+
display: none;
|
282
293
|
|
283
294
|
// It's reapplied to captions because Firefox can't hide
|
284
295
|
// table captions unless it's applied directly to it. Go figure.
|
@@ -21,12 +21,15 @@ module GovukPublishingComponents
|
|
21
21
|
collections-publisher
|
22
22
|
content-data-admin
|
23
23
|
content-publisher
|
24
|
+
datagovuk_find
|
24
25
|
email-alert-frontend
|
25
26
|
feedback
|
26
27
|
finder-frontend
|
27
28
|
frontend
|
28
29
|
government-frontend
|
29
30
|
govspeak-preview
|
31
|
+
govuk-account-manager-prototype
|
32
|
+
govuk-coronavirus-vulnerable-people-form
|
30
33
|
info-frontend
|
31
34
|
licence-finder
|
32
35
|
manuals-frontend
|
@@ -7,6 +7,7 @@ module GovukPublishingComponents
|
|
7
7
|
application_found = application_exists(path)
|
8
8
|
components_found = []
|
9
9
|
@gem_style_references = []
|
10
|
+
@jquery_references = []
|
10
11
|
|
11
12
|
if application_found
|
12
13
|
templates = Dir["#{path}/app/views/**/*.erb"]
|
@@ -65,6 +66,7 @@ module GovukPublishingComponents
|
|
65
66
|
application_found: application_found,
|
66
67
|
components_found: components_found,
|
67
68
|
gem_style_references: @gem_style_references.flatten.uniq.sort,
|
69
|
+
jquery_references: @jquery_references.flatten.uniq.sort,
|
68
70
|
}
|
69
71
|
end
|
70
72
|
|
@@ -76,8 +78,14 @@ module GovukPublishingComponents
|
|
76
78
|
files.each do |file|
|
77
79
|
src = File.read(file)
|
78
80
|
components_found << find_match(find, src, type)
|
79
|
-
|
80
|
-
|
81
|
+
|
82
|
+
if type == "javascripts"
|
83
|
+
jquery_references = find_code_references(file, src, /\$\(/)
|
84
|
+
@jquery_references << jquery_references if jquery_references
|
85
|
+
else
|
86
|
+
gem_style_references = find_code_references(file, src, /gem-c-[-_a-zA-Z]+/)
|
87
|
+
@gem_style_references << gem_style_references if gem_style_references
|
88
|
+
end
|
81
89
|
rescue StandardError
|
82
90
|
puts "File #{file} not found"
|
83
91
|
end
|
@@ -99,11 +107,10 @@ module GovukPublishingComponents
|
|
99
107
|
all_matches
|
100
108
|
end
|
101
109
|
|
102
|
-
def
|
103
|
-
find_gem_classes = /gem-c-[-_a-zA-Z]+/
|
110
|
+
def find_code_references(file, src, regex)
|
104
111
|
clean_file_path = /(?<=#{Regexp.escape(@path)}\/)[\/a-zA-Z_-]+.[a-zA-Z.]+/
|
105
112
|
|
106
|
-
return file[clean_file_path] if
|
113
|
+
return file[clean_file_path] if regex.match?(src)
|
107
114
|
end
|
108
115
|
|
109
116
|
def clean_file_name(name)
|
@@ -37,6 +37,7 @@ module GovukPublishingComponents
|
|
37
37
|
warnings << warn_about_missing_components(result[:components_found])
|
38
38
|
warnings << warn_about_missing_assets(result[:components_found])
|
39
39
|
warnings << warn_about_style_overrides(result[:gem_style_references])
|
40
|
+
warnings << warn_about_jquery_references(result[:jquery_references])
|
40
41
|
warnings = warnings.flatten
|
41
42
|
|
42
43
|
data << {
|
@@ -67,6 +68,7 @@ module GovukPublishingComponents
|
|
67
68
|
warnings: warnings,
|
68
69
|
warning_count: warnings.length,
|
69
70
|
gem_style_references: result[:gem_style_references],
|
71
|
+
jquery_references: result[:jquery_references],
|
70
72
|
}
|
71
73
|
else
|
72
74
|
data << {
|
@@ -163,6 +165,16 @@ module GovukPublishingComponents
|
|
163
165
|
warnings
|
164
166
|
end
|
165
167
|
|
168
|
+
def warn_about_jquery_references(results)
|
169
|
+
warnings = []
|
170
|
+
|
171
|
+
results.each do |result|
|
172
|
+
warnings << create_warning("Possible jQuery", result)
|
173
|
+
end
|
174
|
+
|
175
|
+
warnings
|
176
|
+
end
|
177
|
+
|
166
178
|
def find_missing(needle, haystack)
|
167
179
|
(haystack - needle).flatten.sort
|
168
180
|
end
|
@@ -109,6 +109,21 @@
|
|
109
109
|
<% end %>
|
110
110
|
</ul>
|
111
111
|
<% end %>
|
112
|
+
|
113
|
+
<% if application[:jquery_references].any? %>
|
114
|
+
<%= render "govuk_publishing_components/components/heading", {
|
115
|
+
text: "jQuery references",
|
116
|
+
font_size: "m",
|
117
|
+
margin_bottom: 4,
|
118
|
+
heading_level: 3,
|
119
|
+
} %>
|
120
|
+
<p class="govuk-body">This shows JavaScript files that might contain jQuery, which we are trying to remove our dependency on.</p>
|
121
|
+
<ul class="govuk-list govuk-list--bullet">
|
122
|
+
<% application[:jquery_references].each do |ref| %>
|
123
|
+
<li><%= ref %></li>
|
124
|
+
<% end %>
|
125
|
+
</ul>
|
126
|
+
<% end %>
|
112
127
|
<% else %>
|
113
128
|
<p class="govuk-body">This application was not found. This could be because you do not have this repository checked out locally.</p>
|
114
129
|
<% end %>
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<%
|
2
|
+
# button_helper.css_classes generates "gem-c-button"
|
2
3
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
3
4
|
local_assigns[:classes] = shared_helper.classes
|
4
5
|
button = GovukPublishingComponents::Presenters::ButtonHelper.new(local_assigns)
|
@@ -5,6 +5,7 @@
|
|
5
5
|
search ||= false
|
6
6
|
search_left ||= false
|
7
7
|
navigation_items ||= []
|
8
|
+
navigation_aria_label ||= "Top level"
|
8
9
|
remove_bottom_border ||= false
|
9
10
|
search_left ||= false
|
10
11
|
width_class = full_width ? "govuk-header__container--full-width" : "govuk-width-container"
|
@@ -28,7 +29,7 @@
|
|
28
29
|
<%= render "govuk_publishing_components/components/layout_header/search" %>
|
29
30
|
</div>
|
30
31
|
<div class="govuk-header__content gem-c-header__content govuk-grid-column-full">
|
31
|
-
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items %>
|
32
|
+
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items, navigation_aria_label: navigation_aria_label %>
|
32
33
|
</div>
|
33
34
|
</div>
|
34
35
|
<% else %>
|
@@ -37,7 +38,7 @@
|
|
37
38
|
<%= render "govuk_publishing_components/components/layout_header/header_logo", environment: environment, product_name: product_name %>
|
38
39
|
</div>
|
39
40
|
<div class="govuk-header__content gem-c-header__content">
|
40
|
-
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items %>
|
41
|
+
<%= render "govuk_publishing_components/components/layout_header/navigation_items", navigation_items: navigation_items, navigation_aria_label: navigation_aria_label %>
|
41
42
|
</div>
|
42
43
|
<% if search %>
|
43
44
|
<div class="govuk-grid-column-one-third gem-c-layout-header__search">
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<% structured_data = GovukPublishingComponents::Presenters::SchemaOrg.new(page).structured_data %>
|
10
10
|
|
11
11
|
<script type="application/ld+json">
|
12
|
-
<%= raw
|
12
|
+
<%= raw(json_escape(JSON.pretty_generate(structured_data))) %>
|
13
13
|
</script>
|
14
14
|
|
15
15
|
<link rel="canonical" href="<%= page.canonical_url %>" />
|
@@ -0,0 +1,82 @@
|
|
1
|
+
<%
|
2
|
+
brand ||= false
|
3
|
+
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
4
|
+
|
5
|
+
sl_helper = GovukPublishingComponents::Presenters::SubscriptionLinksHelper.new(local_assigns)
|
6
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
7
|
+
|
8
|
+
local_assigns[:margin_bottom] ||= 0
|
9
|
+
local_assigns[:margin_bottom] = 0 if local_assigns[:margin_bottom] > 9
|
10
|
+
|
11
|
+
css_classes = %w( gem-c-subscription-links )
|
12
|
+
css_classes << (shared_helper.get_margin_bottom) unless local_assigns[:margin_bottom] == 0
|
13
|
+
css_classes << brand_helper.brand_class
|
14
|
+
css_classes << "gem-c-subscription-links--with-feed-box" if sl_helper.feed_link_box_value
|
15
|
+
|
16
|
+
data = {"module": "gem-toggle"} if sl_helper.feed_link_box_value
|
17
|
+
|
18
|
+
hide_heading ||= false
|
19
|
+
|
20
|
+
email_signup_link_text_locale = local_assigns[:email_signup_link_text_locale].presence
|
21
|
+
feed_link_text_locale = local_assigns[:feed_link_text_locale].presence
|
22
|
+
%>
|
23
|
+
<% if sl_helper.component_data_is_valid? %>
|
24
|
+
<%= tag.section class: css_classes, data: data do %>
|
25
|
+
<% unless hide_heading %>
|
26
|
+
<h2 class="gem-c-subscription-links__hidden-header visuallyhidden"><%= t("govuk_component.subscription_links.subscriptions", default: "Subscriptions") %></h2>
|
27
|
+
<% end %>
|
28
|
+
<ul
|
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? %>
|
31
|
+
>
|
32
|
+
<% if sl_helper.email_signup_link.present? %>
|
33
|
+
<li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>" >
|
34
|
+
<% email_link_text = capture do %>
|
35
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="21" height="15.75" class="gem-c-subscription-links__icon" focusable="false" fill="currentColor" aria-hidden="true"><path d="M19.687 0H1.312C.589 0 0 .587 0 1.313v13.124c0 .726.588 1.313 1.313 1.313h18.374c.725 0 1.313-.587 1.313-1.313V1.313C21 .587 20.412 0 19.687 0zm-2.625 2.625L10.5 7.875l-6.563-5.25h13.126zm1.313 10.5H2.625V3.937L10.5 10.5l7.875-6.563v9.188z"/></svg>
|
36
|
+
<%= sl_helper.email_signup_link_text %>
|
37
|
+
<% end %>
|
38
|
+
<%= link_to email_link_text, sl_helper.email_signup_link, {
|
39
|
+
class: "gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
|
40
|
+
data: sl_helper.email_signup_link_data_attributes,
|
41
|
+
lang: email_signup_link_text_locale
|
42
|
+
} %>
|
43
|
+
</li>
|
44
|
+
<% end %>
|
45
|
+
|
46
|
+
<% if sl_helper.feed_link_box_value || sl_helper.feed_link %>
|
47
|
+
<li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>">
|
48
|
+
<% feed_link_text = capture do %>
|
49
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" class="gem-c-subscription-links__icon" focusable="false" fill="currentColor" aria-hidden="true"><path d="M1.996 11A2 2 0 0 0 0 12.993c0 1.101.895 1.99 1.996 1.99 1.106 0 2-.889 2-1.99a2 2 0 0 0-2-1.993zM.002 5.097V7.97c1.872 0 3.632.733 4.958 2.059A6.984 6.984 0 0 1 7.015 15h2.888c0-5.461-4.443-9.903-9.9-9.903zM.006 0v2.876c6.676 0 12.11 5.44 12.11 12.124H15C15 6.731 8.273 0 .006 0z"/></svg>
|
50
|
+
<%= sl_helper.feed_link_text %>
|
51
|
+
<% end %>
|
52
|
+
<%= tag.button feed_link_text, {
|
53
|
+
class: "gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--button",
|
54
|
+
data: sl_helper.feed_link_data_attributes,
|
55
|
+
lang: feed_link_text_locale
|
56
|
+
} if sl_helper.feed_link_box_value %>
|
57
|
+
<%= link_to feed_link_text, sl_helper.feed_link,
|
58
|
+
{
|
59
|
+
class: "gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
|
60
|
+
data: sl_helper.feed_link_data_attributes,
|
61
|
+
lang: feed_link_text_locale
|
62
|
+
} unless sl_helper.feed_link_box_value %>
|
63
|
+
</li>
|
64
|
+
<% end %>
|
65
|
+
</ul>
|
66
|
+
|
67
|
+
<% if sl_helper.feed_link_box_value %>
|
68
|
+
<div class="gem-c-subscription-links__feed-box js-hidden" id="<%= sl_helper.feed_box_id %>">
|
69
|
+
<h3 class="gem-c-subscription-links__feed-hidden-description visuallyhidden govuk-!-margin-top-0"><%= sl_helper.feed_link_text %></h3>
|
70
|
+
<div lang="en">
|
71
|
+
<%= render "govuk_publishing_components/components/input", {
|
72
|
+
label: {
|
73
|
+
text: "Copy and paste this URL into your feed reader"
|
74
|
+
},
|
75
|
+
name: "feed-reader-box",
|
76
|
+
value: feed_link_box_value
|
77
|
+
} %>
|
78
|
+
</div>
|
79
|
+
</div>
|
80
|
+
<% end %>
|
81
|
+
<% end %>
|
82
|
+
<% end %>
|
@@ -1,4 +1,7 @@
|
|
1
1
|
<%
|
2
|
+
# DO NOT MAKE CHANGES TO THIS FILE
|
3
|
+
# It is a temporary copy of _translation_nav.html.erb and will be deleted shortly
|
4
|
+
|
2
5
|
brand ||= false
|
3
6
|
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
4
7
|
translation_helper = GovukPublishingComponents::Presenters::TranslationNavHelper.new(local_assigns)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<%
|
2
|
+
brand ||= false
|
3
|
+
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
4
|
+
translation_helper = GovukPublishingComponents::Presenters::TranslationNavHelper.new(local_assigns)
|
5
|
+
%>
|
6
|
+
<% if translation_helper.has_translations? %>
|
7
|
+
<nav role="navigation"
|
8
|
+
class="gem-c-translation-nav <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
|
9
|
+
aria-label="<%= t("common.translations") %>"
|
10
|
+
<%= "data-module=\"track-click\"" if translation_helper.tracking_is_present? %>
|
11
|
+
>
|
12
|
+
<ul class="gem-c-translation-nav__list">
|
13
|
+
<% translation_helper.translations.each.with_index do |translation, i| %>
|
14
|
+
<li class="gem-c-translation-nav__list-item">
|
15
|
+
<% if translation[:active] %>
|
16
|
+
<span lang="<%= translation[:locale] %>"><%= translation[:text] %></span>
|
17
|
+
<% else %>
|
18
|
+
<%= link_to translation[:text], translation[:base_path],
|
19
|
+
hreflang: translation[:locale],
|
20
|
+
lang: translation[:locale],
|
21
|
+
rel: "alternate",
|
22
|
+
class: "gem-c-translation-nav__link #{brand_helper.color_class}",
|
23
|
+
data: translation[:data_attributes]
|
24
|
+
%>
|
25
|
+
<% end %>
|
26
|
+
</li>
|
27
|
+
<% end %>
|
28
|
+
</ul>
|
29
|
+
</nav>
|
30
|
+
<% end %>
|
@@ -60,6 +60,27 @@ examples:
|
|
60
60
|
- text: News and communications
|
61
61
|
href: "item-6"
|
62
62
|
active: true
|
63
|
+
with_custom_navigation_aria_label:
|
64
|
+
description: The navigation has `aria-label="Top level"` by default. This option is here for when the `aria-label` needs to be more descriptive than that.
|
65
|
+
data:
|
66
|
+
search_left: true
|
67
|
+
navigation_aria_label: "Departments and policy"
|
68
|
+
navigation_items:
|
69
|
+
- text: Departments
|
70
|
+
href: "item-1"
|
71
|
+
- text: Worldwide
|
72
|
+
href: "item-2"
|
73
|
+
- text: How government works
|
74
|
+
href: "item-3"
|
75
|
+
- text: Get involved
|
76
|
+
href: "item-4"
|
77
|
+
- text: Consultations
|
78
|
+
href: "item-4"
|
79
|
+
- text: Statistics
|
80
|
+
href: "item-5"
|
81
|
+
- text: News and communications
|
82
|
+
href: "item-6"
|
83
|
+
active: true
|
63
84
|
full_width:
|
64
85
|
description: |
|
65
86
|
This is difficult to preview because the preview windows are constrained, but the header will stretch to the size of its container.
|
@@ -0,0 +1,100 @@
|
|
1
|
+
name: Subscription links
|
2
|
+
description: Links to ‘Get emails’ and ‘Subscribe to feed’
|
3
|
+
body: |
|
4
|
+
<strong>NOTE: This component includes a h2 heading by default but can be suppressed by using `hide_heading` option (see below)<strong>
|
5
|
+
accessibility_criteria: |
|
6
|
+
Icons in subscription links must be presentational and ignored by screen readers.
|
7
|
+
|
8
|
+
Toggle elements in the component must:
|
9
|
+
|
10
|
+
- be usable with a keyboard
|
11
|
+
- be usable with touch
|
12
|
+
- be recognised by screen readers as a button
|
13
|
+
- announce to screen readers whether they are expanded or collapsed
|
14
|
+
- show hidden elements by default when Javascript is disabled
|
15
|
+
shared_accessibility_criteria:
|
16
|
+
- link
|
17
|
+
examples:
|
18
|
+
default:
|
19
|
+
data:
|
20
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
21
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
22
|
+
with_margin:
|
23
|
+
description: The component accepts a number for margin bottom from 0 to 9 (0px to 60px) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having no margin bottom, although some margin is supplied by the links themselves (so that when they stack on mobile there is space between them).
|
24
|
+
data:
|
25
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
26
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
27
|
+
margin_bottom: 9
|
28
|
+
with_only_email_signup_link:
|
29
|
+
data:
|
30
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
31
|
+
with_only_feed_link:
|
32
|
+
data:
|
33
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
34
|
+
with_custom_text:
|
35
|
+
data:
|
36
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
37
|
+
email_signup_link_text: 'Get notifications'
|
38
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
39
|
+
feed_link_text: 'View feed'
|
40
|
+
with_copyable_feed_link:
|
41
|
+
description: |
|
42
|
+
This option changes the feed link to a toggle control, which opens a hidden element containing an input prepopulated with the value passed to the component, usually a URL to an atom feed. This uses the [form input](/component-guide/input) component.
|
43
|
+
|
44
|
+
Note that this option overrides the feed_link option, so if both are passed feed_link is ignored. Note that a value for email_signup_link can also be passed as normal.
|
45
|
+
data:
|
46
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
47
|
+
feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
|
48
|
+
with_branding:
|
49
|
+
description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
|
50
|
+
data:
|
51
|
+
brand: 'attorney-generals-office'
|
52
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
53
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
54
|
+
with_tracking:
|
55
|
+
description: Data attributes can be passed for each link as shown.
|
56
|
+
data:
|
57
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
58
|
+
email_signup_link_data_attributes: {
|
59
|
+
track_category: 'email_link_category',
|
60
|
+
track_action: 1.1,
|
61
|
+
track_label: 'email_link_label',
|
62
|
+
track_options: {
|
63
|
+
dimension28: 1,
|
64
|
+
dimension29: 'dimension29EmailLink'
|
65
|
+
}
|
66
|
+
}
|
67
|
+
feed_link_box_value: 'https://www.gov.uk/government/organisations/attorney-generals-office.atom'
|
68
|
+
feed_link_data_attributes: {
|
69
|
+
track_category: 'feed_link_category',
|
70
|
+
track_action: 1.2,
|
71
|
+
track_label: 'feed_link_label',
|
72
|
+
track_options: {
|
73
|
+
dimension28: 7,
|
74
|
+
dimension29: 'dimension29feedLink'
|
75
|
+
}
|
76
|
+
}
|
77
|
+
as_small_form:
|
78
|
+
data:
|
79
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
80
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
81
|
+
small_form: true
|
82
|
+
without_heading:
|
83
|
+
description: |
|
84
|
+
By default the component includes an h2 heading. The component could be used anywhere on the page and could mean that it produces invalid markup or make the site unaccessible.
|
85
|
+
data:
|
86
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
87
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
88
|
+
hide_heading: true
|
89
|
+
with_a_different_language:
|
90
|
+
data:
|
91
|
+
email_signup_link: '/foreign-travel-advice/singapore/email-signup'
|
92
|
+
email_signup_link_text: 'Recevez des notifications'
|
93
|
+
email_signup_link_text_locale: 'fr'
|
94
|
+
feed_link: '/foreign-travel-advice/singapore.atom'
|
95
|
+
feed_link_text: 'Flux RSS'
|
96
|
+
feed_link_text_locale: 'fr'
|
97
|
+
description: |
|
98
|
+
The component is used on translated pages that don't have a translation for the text strings. This means that it could display the fallback English string if the translate method can't find an appropriate translation. This makes sure that the `lang` can be set to ensure that browsers understand which parts of the page are in each language.
|
99
|
+
|
100
|
+
The `lang` attribute **must** be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is `en` or `eng`, Korean is `ko` or `kor` - but if in doubt please check.
|
@@ -1,3 +1,6 @@
|
|
1
|
+
# DO NOT MAKE CHANGES TO THIS FILE
|
2
|
+
# It is a temporary copy of translation_nav.yml and will be deleted shortly
|
3
|
+
|
1
4
|
name: Translation navigation
|
2
5
|
description: A list of links to available translations
|
3
6
|
body: The active property indicates the current language.
|
@@ -134,4 +137,3 @@ examples:
|
|
134
137
|
dimension29: 'dimension29Welsh'
|
135
138
|
context:
|
136
139
|
dark_background: true
|
137
|
-
|
@@ -0,0 +1,137 @@
|
|
1
|
+
name: Translation navigation
|
2
|
+
description: A list of links to available translations
|
3
|
+
body: The active property indicates the current language.
|
4
|
+
accessibility_criteria: |
|
5
|
+
The component must:
|
6
|
+
|
7
|
+
- be [a landmark with a navigation role](https://accessibility.blog.gov.uk/2016/05/27/using-navigation-landmarks/)
|
8
|
+
- have an accessible name in the current language, eg "Translations"
|
9
|
+
|
10
|
+
The translation links must:
|
11
|
+
|
12
|
+
- [identify the language of the text](https://www.w3.org/TR/UNDERSTANDING-WCAG20/meaning-other-lang-id.html#meaning-other-lang-id-examples-head)
|
13
|
+
|
14
|
+
[Watch a screen reader pronounce text differently based on lang attribute](https://bit.ly/screenreaderpronunciation)
|
15
|
+
shared_accessibility_criteria:
|
16
|
+
- link
|
17
|
+
examples:
|
18
|
+
default:
|
19
|
+
data:
|
20
|
+
translations:
|
21
|
+
- locale: 'en'
|
22
|
+
base_path: '/en'
|
23
|
+
text: 'English'
|
24
|
+
active: true
|
25
|
+
- locale: 'hi'
|
26
|
+
base_path: '/hi'
|
27
|
+
text: 'हिंदी'
|
28
|
+
multiple_translations:
|
29
|
+
data:
|
30
|
+
translations:
|
31
|
+
- locale: 'en'
|
32
|
+
base_path: '/en'
|
33
|
+
text: 'English'
|
34
|
+
active: true
|
35
|
+
- locale: 'fr'
|
36
|
+
base_path: '/fr'
|
37
|
+
text: 'Français'
|
38
|
+
- locale: 'hi'
|
39
|
+
base_path: '/hi'
|
40
|
+
text: 'हिंदी'
|
41
|
+
- locale: 'ja'
|
42
|
+
base_path: '/ja'
|
43
|
+
text: '日本語'
|
44
|
+
- locale: 'ur'
|
45
|
+
base_path: '/ur'
|
46
|
+
text: 'اردو'
|
47
|
+
- locale: 'zh'
|
48
|
+
base_path: '/zh'
|
49
|
+
text: '中文'
|
50
|
+
right_to_left:
|
51
|
+
data:
|
52
|
+
translations:
|
53
|
+
- locale: 'en'
|
54
|
+
base_path: '/en'
|
55
|
+
text: 'English'
|
56
|
+
- locale: 'ar'
|
57
|
+
base_path: '/ar'
|
58
|
+
text: 'العربية'
|
59
|
+
active: true
|
60
|
+
context:
|
61
|
+
right_to_left: true
|
62
|
+
with_branding:
|
63
|
+
description: Organisation [colour branding](https://github.com/alphagov/govuk_publishing_components/blob/master/docs/component_branding.md) can be added to the component as shown.
|
64
|
+
data:
|
65
|
+
brand: 'wales-office'
|
66
|
+
translations:
|
67
|
+
- locale: 'en'
|
68
|
+
base_path: '/en'
|
69
|
+
text: 'English'
|
70
|
+
active: true
|
71
|
+
- locale: 'cy'
|
72
|
+
base_path: '/cy'
|
73
|
+
text: 'Cymraeg'
|
74
|
+
with_no_top_margin:
|
75
|
+
data:
|
76
|
+
no_margin_top: true
|
77
|
+
translations:
|
78
|
+
- locale: 'en'
|
79
|
+
base_path: '/en'
|
80
|
+
text: 'English'
|
81
|
+
active: true
|
82
|
+
- locale: 'cy'
|
83
|
+
base_path: '/cy'
|
84
|
+
text: 'Cymraeg'
|
85
|
+
with_tracking:
|
86
|
+
description: Data attributes can be passed for each link as shown.
|
87
|
+
data:
|
88
|
+
translations:
|
89
|
+
- locale: 'en'
|
90
|
+
base_path: '/en'
|
91
|
+
text: 'English'
|
92
|
+
active: true
|
93
|
+
data_attributes:
|
94
|
+
track_category: 'categoryEnglish'
|
95
|
+
track_action: 1.1
|
96
|
+
track_label: 'labelEnglish'
|
97
|
+
track_options:
|
98
|
+
dimension28: 1
|
99
|
+
dimension29: 'dimension29English'
|
100
|
+
- locale: 'cy'
|
101
|
+
base_path: '/cy'
|
102
|
+
text: 'Cymraeg'
|
103
|
+
data_attributes:
|
104
|
+
track_category: 'categoryWelsh'
|
105
|
+
track_action: 1.2
|
106
|
+
track_label: 'labelWelsh'
|
107
|
+
track_options:
|
108
|
+
dimension28: 1
|
109
|
+
dimension29: 'dimension29Welsh'
|
110
|
+
inverse:
|
111
|
+
data:
|
112
|
+
inverse: true
|
113
|
+
translations:
|
114
|
+
- locale: 'en'
|
115
|
+
base_path: '/en'
|
116
|
+
text: 'English'
|
117
|
+
active: true
|
118
|
+
data_attributes:
|
119
|
+
track_category: 'categoryEnglish'
|
120
|
+
track_action: 1.1
|
121
|
+
track_label: 'labelEnglish'
|
122
|
+
track_options:
|
123
|
+
dimension28: 1
|
124
|
+
dimension29: 'dimension29English'
|
125
|
+
- locale: 'cy'
|
126
|
+
base_path: '/cy'
|
127
|
+
text: 'Cymraeg'
|
128
|
+
data_attributes:
|
129
|
+
track_category: 'categoryWelsh'
|
130
|
+
track_action: 1.2
|
131
|
+
track_label: 'labelWelsh'
|
132
|
+
track_options:
|
133
|
+
dimension28: 1
|
134
|
+
dimension29: 'dimension29Welsh'
|
135
|
+
context:
|
136
|
+
dark_background: true
|
137
|
+
|
data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<% if navigation_items.any? %>
|
2
2
|
<button role="button" class="govuk-header__menu-button gem-c-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button>
|
3
|
-
|
4
|
-
<ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end"
|
3
|
+
<%= tag.nav(class: "gem-c-header__nav", 'aria-label': navigation_aria_label ? navigation_aria_label : nil ) do %>
|
4
|
+
<ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end">
|
5
5
|
<% navigation_items.each_with_index do |item, index| %>
|
6
6
|
<li class="govuk-header__navigation-item <%= "govuk-header__navigation-item--active" if item[:active] %>
|
7
7
|
<%= "govuk-header__navigation-item--collapsed-menu-only" if item[:show_only_in_collapsed_menu] %>">
|
@@ -13,5 +13,5 @@
|
|
13
13
|
</li>
|
14
14
|
<% end %>
|
15
15
|
</ul>
|
16
|
-
|
16
|
+
<% end %>
|
17
17
|
<% end %>
|
data/config/locales/cy.yml
CHANGED
data/config/locales/en.yml
CHANGED
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: 23.
|
4
|
+
version: 23.12.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:
|
11
|
+
date: 2021-01-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -426,6 +426,7 @@ files:
|
|
426
426
|
- app/assets/javascripts/govuk_publishing_components/components/feedback.js
|
427
427
|
- app/assets/javascripts/govuk_publishing_components/components/govspeak.js
|
428
428
|
- app/assets/javascripts/govuk_publishing_components/components/header.js
|
429
|
+
- app/assets/javascripts/govuk_publishing_components/components/layout-header.js
|
429
430
|
- app/assets/javascripts/govuk_publishing_components/components/modal-dialogue.js
|
430
431
|
- app/assets/javascripts/govuk_publishing_components/components/print-link.js
|
431
432
|
- app/assets/javascripts/govuk_publishing_components/components/radio.js
|
@@ -525,7 +526,6 @@ files:
|
|
525
526
|
- app/assets/stylesheets/govuk_publishing_components/components/_taxonomy-list.scss
|
526
527
|
- app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss
|
527
528
|
- app/assets/stylesheets/govuk_publishing_components/components/_title.scss
|
528
|
-
- app/assets/stylesheets/govuk_publishing_components/components/_transition-countdown.scss
|
529
529
|
- app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss
|
530
530
|
- app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss
|
531
531
|
- app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss
|
@@ -671,6 +671,7 @@ files:
|
|
671
671
|
- app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb
|
672
672
|
- app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb
|
673
673
|
- app/views/govuk_publishing_components/components/_subscription-links.html.erb
|
674
|
+
- app/views/govuk_publishing_components/components/_subscription_links.html.erb
|
674
675
|
- app/views/govuk_publishing_components/components/_success_alert.html.erb
|
675
676
|
- app/views/govuk_publishing_components/components/_summary_list.html.erb
|
676
677
|
- app/views/govuk_publishing_components/components/_table.html.erb
|
@@ -679,6 +680,7 @@ files:
|
|
679
680
|
- app/views/govuk_publishing_components/components/_textarea.html.erb
|
680
681
|
- app/views/govuk_publishing_components/components/_title.html.erb
|
681
682
|
- app/views/govuk_publishing_components/components/_translation-nav.html.erb
|
683
|
+
- app/views/govuk_publishing_components/components/_translation_nav.html.erb
|
682
684
|
- app/views/govuk_publishing_components/components/_warning_text.html.erb
|
683
685
|
- app/views/govuk_publishing_components/components/attachment/_thumbnail_document.svg
|
684
686
|
- app/views/govuk_publishing_components/components/attachment/_thumbnail_generic.svg
|
@@ -751,6 +753,7 @@ files:
|
|
751
753
|
- app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml
|
752
754
|
- app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml
|
753
755
|
- app/views/govuk_publishing_components/components/docs/subscription-links.yml
|
756
|
+
- app/views/govuk_publishing_components/components/docs/subscription_links.yml
|
754
757
|
- app/views/govuk_publishing_components/components/docs/success_alert.yml
|
755
758
|
- app/views/govuk_publishing_components/components/docs/summary_list.yml
|
756
759
|
- app/views/govuk_publishing_components/components/docs/table.yml
|
@@ -759,6 +762,7 @@ files:
|
|
759
762
|
- app/views/govuk_publishing_components/components/docs/textarea.yml
|
760
763
|
- app/views/govuk_publishing_components/components/docs/title.yml
|
761
764
|
- app/views/govuk_publishing_components/components/docs/translation-nav.yml
|
765
|
+
- app/views/govuk_publishing_components/components/docs/translation_nav.yml
|
762
766
|
- app/views/govuk_publishing_components/components/docs/warning_text.yml
|
763
767
|
- app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb
|
764
768
|
- app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb
|
data/app/assets/stylesheets/govuk_publishing_components/components/_transition-countdown.scss
DELETED
@@ -1,125 +0,0 @@
|
|
1
|
-
$transition-campaign-red: #ff003b;
|
2
|
-
$transition-campaign-dark-blue: #1e1348;
|
3
|
-
|
4
|
-
.gem-c-transition-countdown {
|
5
|
-
@include govuk-font(19);
|
6
|
-
margin-bottom: govuk-spacing(6);
|
7
|
-
}
|
8
|
-
|
9
|
-
.gem-c-transition-countdown--cta {
|
10
|
-
background-color: govuk-colour('light-grey', $legacy: 'grey-4');
|
11
|
-
border-top: 4px solid $transition-campaign-red;
|
12
|
-
display: block;
|
13
|
-
padding: govuk-spacing(3);
|
14
|
-
text-decoration: none;
|
15
|
-
}
|
16
|
-
|
17
|
-
.gem-c-transition-countdown__title {
|
18
|
-
@extend %govuk-heading-m;
|
19
|
-
color: $transition-campaign-dark-blue;
|
20
|
-
}
|
21
|
-
|
22
|
-
.gem-c-transition-countdown__countdown {
|
23
|
-
margin-top: 0;
|
24
|
-
margin-bottom: govuk-spacing(2);
|
25
|
-
|
26
|
-
@include govuk-media-query($from: tablet) {
|
27
|
-
margin-bottom: govuk-spacing(0);
|
28
|
-
}
|
29
|
-
}
|
30
|
-
|
31
|
-
.gem-c-transition-countdown__countdown-number {
|
32
|
-
@include govuk-font($size: 80, $weight: bold, $line-height: 60px);
|
33
|
-
|
34
|
-
min-width: 50px;
|
35
|
-
text-align: center;
|
36
|
-
display: inline-block;
|
37
|
-
background: $transition-campaign-dark-blue;
|
38
|
-
color: govuk-colour('white');
|
39
|
-
position: relative;
|
40
|
-
margin-bottom: govuk-spacing(2);
|
41
|
-
|
42
|
-
@include govuk-media-query($from: tablet) {
|
43
|
-
padding: govuk-spacing(2) govuk-spacing(1);
|
44
|
-
}
|
45
|
-
|
46
|
-
&:after {
|
47
|
-
position: absolute;
|
48
|
-
left: 0;
|
49
|
-
top: 50%;
|
50
|
-
margin-top: -1px;
|
51
|
-
height: 3px;
|
52
|
-
background: govuk-colour('white');
|
53
|
-
content: '';
|
54
|
-
width: 100%;
|
55
|
-
display: block;
|
56
|
-
}
|
57
|
-
|
58
|
-
&:first-child {
|
59
|
-
margin-right: 3px;
|
60
|
-
}
|
61
|
-
|
62
|
-
&:nth-child(2) {
|
63
|
-
margin-right: govuk-spacing(2);
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
.gem-c-transition-countdown__countdown-text {
|
68
|
-
@extend %govuk-heading-m;
|
69
|
-
|
70
|
-
display: inline-block;
|
71
|
-
margin-bottom: 0;
|
72
|
-
height: 45px;
|
73
|
-
vertical-align: middle;
|
74
|
-
color: $transition-campaign-dark-blue;
|
75
|
-
|
76
|
-
@include govuk-media-query($from: tablet) {
|
77
|
-
height: 80px;
|
78
|
-
}
|
79
|
-
|
80
|
-
&:after {
|
81
|
-
content: '' / '.'; // Wrap up the countdown-text element in a statement for screen readers
|
82
|
-
}
|
83
|
-
}
|
84
|
-
|
85
|
-
.gem-c-transition-countdown__text {
|
86
|
-
@extend %govuk-link;
|
87
|
-
|
88
|
-
margin-top: 0;
|
89
|
-
margin-bottom: 0;
|
90
|
-
text-decoration: underline;
|
91
|
-
|
92
|
-
@include govuk-media-query($from: tablet) {
|
93
|
-
margin-bottom: govuk-spacing(2);
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
.gem-c-transition-countdown:focus {
|
98
|
-
.gem-c-transition-countdown__countdown-number:after {
|
99
|
-
background-color: $govuk-focus-colour;
|
100
|
-
}
|
101
|
-
|
102
|
-
.gem-c-transition-countdown__text {
|
103
|
-
text-decoration: none;
|
104
|
-
}
|
105
|
-
}
|
106
|
-
|
107
|
-
@include govuk-compatibility(govuk_template) {
|
108
|
-
.gem-c-transition-countdown__title {
|
109
|
-
margin-bottom: govuk-spacing(3);
|
110
|
-
}
|
111
|
-
|
112
|
-
.gem-c-transition-countdown__countdown-number {
|
113
|
-
padding: govuk-spacing(1) 0 0;
|
114
|
-
|
115
|
-
@include govuk-media-query($from: tablet) {
|
116
|
-
padding: govuk-spacing(3) govuk-spacing(1) govuk-spacing(1);
|
117
|
-
}
|
118
|
-
}
|
119
|
-
|
120
|
-
.gem-c-transition-countdown__countdown-text {
|
121
|
-
@include govuk-media-query($from: tablet) {
|
122
|
-
height: 75px;
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|