govuk_publishing_components 23.11.1 → 23.13.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/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/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/meta_tags.yml +99 -1
- 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/lib/govuk_publishing_components/presenters/meta_tags.rb +2 -0
- 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: 8d8c74adc692bb0b7466ea5eba32bd121b8bf4470b7cb78c71732f5de5143e35
|
4
|
+
data.tar.gz: c2ac6affcff44c35c9c47652945181cc59906db32e575ca25b937a120af59d0c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d615bae60cc517e98114ebf4185fc9686d45b0860e3bf38988827a77e1338b84c2e3e13cc1b04a1841c99157d5bba8f4f751ab6046c6ff4eee7d87b9640952bf
|
7
|
+
data.tar.gz: 1ab8e32b4933e8de6642a5e30d48071d5590bfff81d72c6068d3b7093bf905b3025a6762f2c664171fc6e6b0e547ce1e10cf7e5fd439571e832080cd2f5eacd0
|
@@ -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.
|
@@ -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.
|
@@ -4,11 +4,43 @@ body: |
|
|
4
4
|
This takes a content-store links hash like object which it can then turn into
|
5
5
|
the correct analytics identifier metadata tags.
|
6
6
|
|
7
|
-
|
7
|
+
These are additionally used by the <a href="https://github.com/alphagov/govuk-browser-extension">GOV.UK browser extension</a> to provide details about a given page.
|
8
|
+
|
9
|
+
The code which reads the meta tags can be found <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js">in custom-dimensions.js</a>.
|
8
10
|
accessibility_criteria: |
|
9
11
|
The analytics meta tags component should not be visible to any users.
|
10
12
|
display_html: true
|
11
13
|
examples:
|
14
|
+
with_core_tags:
|
15
|
+
data:
|
16
|
+
content_item:
|
17
|
+
document_type: "html_publication"
|
18
|
+
publishing_app: "whitehall"
|
19
|
+
schema_name: "html_publication"
|
20
|
+
content_id: "00000000-0000-0000-0000-00000000000"
|
21
|
+
navigation_page_type: "Taxon Page"
|
22
|
+
section: "business tax"
|
23
|
+
withdrawn_notice: true
|
24
|
+
with_content_history_tags:
|
25
|
+
description: |
|
26
|
+
The tags in this object will generate the `content-has-history` tag, set to true. This tag is triggered when either, within `content_item`:
|
27
|
+
|
28
|
+
1. `public_updated_at` and `first_public_at` within `details` are both present and they aren't the same value
|
29
|
+
2. `change_history` within `details` is present and it has a value of more than 1
|
30
|
+
|
31
|
+
See below example for specific details.
|
32
|
+
data:
|
33
|
+
content_item:
|
34
|
+
public_updated_at: "2021-01-15T12:30:45.000+00:00"
|
35
|
+
details:
|
36
|
+
first_public_at: "2020-11-03T09:15:00.000+00:00"
|
37
|
+
change_history: "5"
|
38
|
+
with_date_and_postcode_stripping_for_static_analytics:
|
39
|
+
data:
|
40
|
+
content_item:
|
41
|
+
local_assigns:
|
42
|
+
strip_dates_pii: true
|
43
|
+
strip_postcodes_pii: true
|
12
44
|
with_organisations:
|
13
45
|
data:
|
14
46
|
content_item:
|
@@ -24,3 +56,69 @@ examples:
|
|
24
56
|
links:
|
25
57
|
world_locations:
|
26
58
|
- analytics_identifier: WL3
|
59
|
+
with_political_tags:
|
60
|
+
data:
|
61
|
+
content_item:
|
62
|
+
details:
|
63
|
+
political: true
|
64
|
+
government:
|
65
|
+
current: true
|
66
|
+
slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
|
67
|
+
with_historic_political_tags:
|
68
|
+
data:
|
69
|
+
content_item:
|
70
|
+
details:
|
71
|
+
political: true
|
72
|
+
government:
|
73
|
+
current: false
|
74
|
+
slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
|
75
|
+
with_non-political_tags:
|
76
|
+
data:
|
77
|
+
content_item:
|
78
|
+
details:
|
79
|
+
political: false
|
80
|
+
government:
|
81
|
+
slug: "2010-to-2015-conservative-and-liberal-democrat-coalition-government"
|
82
|
+
with_taxonomy_added_via_document_type:
|
83
|
+
description: |
|
84
|
+
You can trigger taxonomy tag rendering by either including a `document_type` attributes of "taxon" or including the `parent_taxons` or `taxons` attributes under the `links` attribute.
|
85
|
+
data:
|
86
|
+
content_item:
|
87
|
+
content_id: "00000000-0000-0000-0000-000000000000"
|
88
|
+
document_type: "taxon"
|
89
|
+
base_path: "/example-of-taxons"
|
90
|
+
with_taxonomy_added_via_links:
|
91
|
+
data:
|
92
|
+
content_item:
|
93
|
+
links:
|
94
|
+
taxons:
|
95
|
+
- content_id: "11111111-1111-1111-1111-111111111111"
|
96
|
+
document_type: "taxon"
|
97
|
+
base_path: "/disabilities-benefits"
|
98
|
+
- content_id: "22222222-2222-2222-2222-222222222222"
|
99
|
+
document_type: "taxon"
|
100
|
+
base_path: "/childcare-parenting/childrens-social-care-providers"
|
101
|
+
links:
|
102
|
+
parent_taxons:
|
103
|
+
- content_id: "33333333-3333-3333-3333-333333333333"
|
104
|
+
document_type: "taxon"
|
105
|
+
base_path: "/childcare-parenting"
|
106
|
+
with_multiple_step_by_step_tags:
|
107
|
+
data:
|
108
|
+
content_item:
|
109
|
+
links:
|
110
|
+
part_of_step_navs:
|
111
|
+
- content_id: "00000000-0000-0000-0000-000000000000"
|
112
|
+
- content_id: "11111111-1111-1111-1111-111111111111"
|
113
|
+
with_primary_step_by_step_tag:
|
114
|
+
data:
|
115
|
+
content_item:
|
116
|
+
links:
|
117
|
+
part_of_step_navs:
|
118
|
+
- content_id: "00000000-0000-0000-0000-000000000000"
|
119
|
+
with_secondary_step_by_step_tag:
|
120
|
+
data:
|
121
|
+
content_item:
|
122
|
+
links:
|
123
|
+
secondary_to_step_navs:
|
124
|
+
- content_id: "22222222-2222-2222-2222-222222222222"
|
@@ -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 %>
|
@@ -31,6 +31,8 @@ module GovukPublishingComponents
|
|
31
31
|
meta_tags["govuk:publishing-application"] = content_item[:publishing_app] if content_item[:publishing_app]
|
32
32
|
meta_tags["govuk:schema-name"] = content_item[:schema_name] if content_item[:schema_name]
|
33
33
|
meta_tags["govuk:content-id"] = content_item[:content_id] if content_item[:content_id]
|
34
|
+
meta_tags["govuk:navigation-page-type"] = content_item[:navigation_page_type] if content_item[:navigation_page_type]
|
35
|
+
meta_tags["govuk:section"] = content_item[:section] if content_item[:section]
|
34
36
|
meta_tags["govuk:withdrawn"] = "withdrawn" if content_item[:withdrawn_notice].present?
|
35
37
|
meta_tags["govuk:content-has-history"] = "true" if has_content_history?
|
36
38
|
meta_tags["govuk:static-analytics:strip-dates"] = "true" if should_strip_dates_pii?(content_item, local_assigns)
|
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.13.0
|
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: 2021-01-
|
11
|
+
date: 2021-01-15 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
|
-
}
|