govuk_publishing_components 24.13.0 → 24.13.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/analytics.js +3 -1
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +2 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +1 -1
  5. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +6 -5
  6. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +9 -7
  7. data/app/assets/javascripts/govuk_publishing_components/components/contextual-guidance.js +6 -7
  8. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +7 -7
  9. data/app/assets/javascripts/govuk_publishing_components/components/copy-to-clipboard.js +13 -12
  10. data/app/assets/javascripts/govuk_publishing_components/components/details.js +12 -18
  11. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +213 -215
  12. data/app/assets/javascripts/govuk_publishing_components/components/govspeak.js +4 -4
  13. data/app/assets/javascripts/govuk_publishing_components/components/modal-dialogue.js +6 -4
  14. data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +4 -3
  15. data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +13 -13
  16. data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +5 -4
  17. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +4 -4
  18. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +3 -3
  19. data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +6 -0
  20. data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +5 -3
  21. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +1 -1
  22. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +50 -8
  23. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -0
  24. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +11 -2
  25. data/app/views/govuk_publishing_components/components/_search.html.erb +5 -2
  26. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +9 -4
  27. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +3 -3
  28. data/config/locales/ar.yml +3 -0
  29. data/config/locales/az.yml +3 -0
  30. data/config/locales/be.yml +3 -0
  31. data/config/locales/bg.yml +3 -0
  32. data/config/locales/bn.yml +3 -0
  33. data/config/locales/cs.yml +3 -0
  34. data/config/locales/cy.yml +4 -1
  35. data/config/locales/da.yml +3 -0
  36. data/config/locales/de.yml +3 -0
  37. data/config/locales/dr.yml +3 -0
  38. data/config/locales/el.yml +3 -0
  39. data/config/locales/en.yml +4 -1
  40. data/config/locales/es-419.yml +3 -0
  41. data/config/locales/es.yml +3 -0
  42. data/config/locales/et.yml +3 -0
  43. data/config/locales/fa.yml +3 -0
  44. data/config/locales/fi.yml +3 -0
  45. data/config/locales/fr.yml +3 -0
  46. data/config/locales/gd.yml +3 -0
  47. data/config/locales/gu.yml +3 -0
  48. data/config/locales/he.yml +3 -0
  49. data/config/locales/hi.yml +3 -0
  50. data/config/locales/hr.yml +3 -0
  51. data/config/locales/hu.yml +3 -0
  52. data/config/locales/hy.yml +3 -0
  53. data/config/locales/id.yml +3 -0
  54. data/config/locales/is.yml +3 -0
  55. data/config/locales/it.yml +3 -0
  56. data/config/locales/ja.yml +3 -0
  57. data/config/locales/ka.yml +3 -0
  58. data/config/locales/kk.yml +3 -0
  59. data/config/locales/ko.yml +3 -0
  60. data/config/locales/lt.yml +3 -0
  61. data/config/locales/lv.yml +3 -0
  62. data/config/locales/ms.yml +3 -0
  63. data/config/locales/mt.yml +3 -0
  64. data/config/locales/nl.yml +3 -0
  65. data/config/locales/no.yml +3 -0
  66. data/config/locales/pa-pk.yml +3 -0
  67. data/config/locales/pa.yml +3 -0
  68. data/config/locales/pl.yml +3 -0
  69. data/config/locales/ps.yml +3 -0
  70. data/config/locales/pt.yml +3 -0
  71. data/config/locales/ro.yml +3 -0
  72. data/config/locales/ru.yml +3 -0
  73. data/config/locales/si.yml +3 -0
  74. data/config/locales/sk.yml +3 -0
  75. data/config/locales/sl.yml +3 -0
  76. data/config/locales/so.yml +3 -0
  77. data/config/locales/sq.yml +3 -0
  78. data/config/locales/sr.yml +3 -0
  79. data/config/locales/sv.yml +3 -0
  80. data/config/locales/sw.yml +3 -0
  81. data/config/locales/ta.yml +3 -0
  82. data/config/locales/th.yml +3 -0
  83. data/config/locales/tk.yml +3 -0
  84. data/config/locales/tr.yml +3 -0
  85. data/config/locales/uk.yml +3 -0
  86. data/config/locales/ur.yml +3 -0
  87. data/config/locales/uz.yml +3 -0
  88. data/config/locales/vi.yml +3 -0
  89. data/config/locales/zh-hk.yml +3 -0
  90. data/config/locales/zh-tw.yml +3 -0
  91. data/config/locales/zh.yml +3 -0
  92. data/lib/govuk_publishing_components.rb +1 -0
  93. data/lib/govuk_publishing_components/presenters/brexit_cta_helper.rb +33 -0
  94. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +32 -3
  95. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +1 -0
  96. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +1 -1
  97. data/lib/govuk_publishing_components/version.rb +1 -1
  98. metadata +4 -3
@@ -2,11 +2,11 @@ window.GOVUK = window.GOVUK || {}
2
2
  window.GOVUK.Modules = window.GOVUK.Modules || {};
3
3
 
4
4
  (function (Modules) {
5
- function Govspeak () { }
6
-
7
- Govspeak.prototype.start = function ($module) {
8
- this.$module = $module[0]
5
+ function Govspeak ($module) {
6
+ this.$module = $module
7
+ }
9
8
 
9
+ Govspeak.prototype.init = function () {
10
10
  if (this.$module.className.indexOf('disable-youtube') === -1) {
11
11
  this.embedYoutube()
12
12
  }
@@ -2,14 +2,16 @@ window.GOVUK = window.GOVUK || {}
2
2
  window.GOVUK.Modules = window.GOVUK.Modules || {};
3
3
 
4
4
  (function (Modules) {
5
- function ModalDialogue () { }
6
-
7
- ModalDialogue.prototype.start = function ($module) {
8
- this.$module = $module[0]
5
+ function ModalDialogue ($module) {
6
+ this.$module = $module
9
7
  this.$dialogBox = this.$module.querySelector('.gem-c-modal-dialogue__box')
10
8
  this.$closeButton = this.$module.querySelector('.gem-c-modal-dialogue__close-button')
11
9
  this.$html = document.querySelector('html')
12
10
  this.$body = document.querySelector('body')
11
+ }
12
+
13
+ ModalDialogue.prototype.init = function () {
14
+ if (!this.$dialogBox || !this.$closeButton) return
13
15
 
14
16
  this.$module.resize = this.handleResize.bind(this)
15
17
  this.$module.open = this.handleOpen.bind(this)
@@ -2,10 +2,11 @@ window.GOVUK = window.GOVUK || {}
2
2
  window.GOVUK.Modules = window.GOVUK.Modules || {};
3
3
 
4
4
  (function (Modules) {
5
- function PrintLink () { }
5
+ function PrintLink ($module) {
6
+ this.$module = $module
7
+ }
6
8
 
7
- PrintLink.prototype.start = function ($module) {
8
- this.$module = $module[0]
9
+ PrintLink.prototype.init = function () {
9
10
  this.$module.addEventListener('click', function () {
10
11
  window.print()
11
12
  })
@@ -3,13 +3,13 @@ window.GOVUK = window.GOVUK || {}
3
3
  window.GOVUK.Modules = window.GOVUK.Modules || {};
4
4
 
5
5
  (function (Modules) {
6
- function ReorderableList () { }
7
-
8
- ReorderableList.prototype.start = function ($module) {
9
- this.$module = $module[0]
6
+ function ReorderableList ($module) {
7
+ this.$module = $module
10
8
  this.$upButtons = this.$module.querySelectorAll('.js-reorderable-list-up')
11
9
  this.$downButtons = this.$module.querySelectorAll('.js-reorderable-list-down')
10
+ }
12
11
 
12
+ ReorderableList.prototype.init = function () {
13
13
  this.sortable = window.Sortable.create(this.$module, { // eslint-disable-line new-cap
14
14
  chosenClass: 'gem-c-reorderable-list__item--chosen',
15
15
  dragClass: 'gem-c-reorderable-list__item--drag',
@@ -26,14 +26,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
26
26
  }
27
27
 
28
28
  var boundOnClickUpButton = this.onClickUpButton.bind(this)
29
- this.$upButtons.forEach(function (button) {
30
- button.addEventListener('click', boundOnClickUpButton)
31
- })
29
+ for (var u = 0; u < this.$upButtons.length; u++) {
30
+ this.$upButtons[u].addEventListener('click', boundOnClickUpButton)
31
+ }
32
32
 
33
33
  var boundOnClickDownButton = this.onClickDownButton.bind(this)
34
- this.$downButtons.forEach(function (button) {
35
- button.addEventListener('click', boundOnClickDownButton)
36
- })
34
+ for (var d = 0; d < this.$downButtons.length; d++) {
35
+ this.$downButtons[d].addEventListener('click', boundOnClickDownButton)
36
+ }
37
37
  }
38
38
 
39
39
  ReorderableList.prototype.setupResponsiveChecks = function () {
@@ -85,9 +85,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
85
85
 
86
86
  ReorderableList.prototype.updateOrderIndexes = function () {
87
87
  var $orderInputs = this.$module.querySelectorAll('.gem-c-reorderable-list__actions input')
88
- $orderInputs.forEach(function (input, index) {
89
- input.setAttribute('value', index + 1)
90
- })
88
+ for (var i = 0; i < $orderInputs.length; i++) {
89
+ $orderInputs[i].setAttribute('value', i + 1)
90
+ }
91
91
  }
92
92
 
93
93
  ReorderableList.prototype.triggerEvent = function (element, eventName) {
@@ -2,11 +2,12 @@ window.GOVUK = window.GOVUK || {}
2
2
  window.GOVUK.Modules = window.GOVUK.Modules || {};
3
3
 
4
4
  (function (Modules) {
5
- function ShowPassword () { }
6
-
7
- ShowPassword.prototype.start = function ($module) {
8
- this.$module = $module[0]
5
+ function ShowPassword ($module) {
6
+ this.$module = $module
9
7
  this.input = this.$module.querySelector('.gem-c-input')
8
+ }
9
+
10
+ ShowPassword.prototype.init = function () {
10
11
  this.$module.togglePassword = this.togglePassword.bind(this)
11
12
  this.$module.revertToPasswordOnFormSubmit = this.revertToPasswordOnFormSubmit.bind(this)
12
13
  this.input.classList.add('gem-c-input--with-password')
@@ -6,10 +6,8 @@ window.GOVUK = window.GOVUK || {}
6
6
  window.GOVUK.Modules = window.GOVUK.Modules || {};
7
7
 
8
8
  (function (Modules) {
9
- function Gemstepnav () { }
10
-
11
- Gemstepnav.prototype.start = function ($module) {
12
- this.$module = $module[0]
9
+ function Gemstepnav ($module) {
10
+ this.$module = $module
13
11
  this.$module.actions = {} // stores text for JS appended elements 'show' and 'hide' on steps, and 'show/hide all' button
14
12
  this.$module.rememberShownStep = false
15
13
  this.$module.stepNavSize = false
@@ -18,7 +16,9 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
18
16
  this.$module.activeStepClass = 'gem-c-step-nav__step--active'
19
17
  this.$module.activeLinkHref = '#content'
20
18
  this.$module.uniqueId = false
19
+ }
21
20
 
21
+ Gemstepnav.prototype.init = function () {
22
22
  // Indicate that js has worked
23
23
  this.$module.classList.add('gem-c-step-nav--active')
24
24
 
@@ -462,11 +462,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
462
462
  var allCharts = document.querySelectorAll('table.js-barchart-table')
463
463
  var id = null
464
464
 
465
- allCharts.forEach(function (chart, i) {
466
- if (chart === module) {
465
+ for (var i = 0; i < allCharts.length; i++) {
466
+ if (allCharts[i] === module) {
467
467
  id = i
468
468
  }
469
- })
469
+ }
470
470
 
471
471
  return id
472
472
  }
@@ -21,8 +21,14 @@
21
21
 
22
22
  if (targetClass.indexOf('js-visible') !== -1) {
23
23
  target.setAttribute('class', targetClass.replace(/(^|\s)js-visible(\s|$)/, ''))
24
+ if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
25
+ window.GOVUK.analytics.trackEvent('headerClicked', 'searchClosed', { label: 'none' })
26
+ }
24
27
  } else {
25
28
  target.setAttribute('class', targetClass + ' js-visible')
29
+ if (window.GOVUK.analytics && window.GOVUK.analytics.trackEvent) {
30
+ window.GOVUK.analytics.trackEvent('headerClicked', 'searchOpened', { label: 'none' })
31
+ }
26
32
  }
27
33
  if (sourceClass.indexOf('js-visible') !== -1) {
28
34
  this.setAttribute('class', sourceClass.replace(/(^|\s)js-visible(\s|$)/, ''))
@@ -2,15 +2,17 @@
2
2
  'use strict'
3
3
  window.GOVUK = window.GOVUK || {}
4
4
 
5
- window.GOVUK.triggerEvent = function (element, eventName) {
6
- var params = { bubbles: true, cancelable: true }
5
+ window.GOVUK.triggerEvent = function (element, eventName, parameters) {
6
+ var params = parameters || {}
7
+ params.bubbles = true
8
+ params.cancelable = true
7
9
  var event
8
10
 
9
11
  if (typeof window.CustomEvent === 'function') {
10
12
  event = new window.CustomEvent(eventName, params)
11
13
  } else {
12
14
  event = document.createEvent('CustomEvent')
13
- event.initCustomEvent(eventName, params.bubbles, params.cancelable, null)
15
+ event.initCustomEvent(eventName, params.bubbles, params.cancelable, params.detail)
14
16
  }
15
17
 
16
18
  element.dispatchEvent(event)
@@ -25,6 +25,6 @@
25
25
  <% end %>
26
26
 
27
27
  <% if navigation.show_brexit_cta? || navigation.show_brexit_related_links? %>
28
- <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
28
+ <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta', content_item: content_item %>
29
29
  <% end %>
30
30
  </div>
@@ -3,39 +3,81 @@
3
3
  %>
4
4
 
5
5
  <nav id="proposition-menu" class="no-proposition-name gem-c-government-navigation" aria-label="Departments and policy navigation">
6
- <ul id="proposition-links">
6
+ <ul id="proposition-links" data-module="gem-track-click">
7
7
  <li>
8
- <a class="<%= 'active' if active == 'departments' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/organisations">
8
+ <a class="<%= 'active' if active == 'departments' %> govuk-link govuk-link--no-underline govuk-link--inverse"
9
+ data-track-category="headerClicked"
10
+ data-track-action="departmentsLink"
11
+ data-track-label="/government/organisations"
12
+ data-track-dimension="<%= t("components.government_navigation.departments") %>"
13
+ data-track-dimension-index="29"
14
+ href="/government/organisations">
9
15
  <%= t("components.government_navigation.departments") %>
10
16
  </a>
11
17
  </li>
12
18
  <li>
13
- <a class="<%= 'active' if active == 'worldwide' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/world">
19
+ <a class="<%= 'active' if active == 'worldwide' %> govuk-link govuk-link--no-underline govuk-link--inverse"
20
+ data-track-category="headerClicked"
21
+ data-track-action="worldwideLink"
22
+ data-track-label="/world"
23
+ data-track-dimension="<%= t("components.government_navigation.worldwide") %>"
24
+ data-track-dimension-index="29"
25
+ href="/world">
14
26
  <%= t("components.government_navigation.worldwide") %>
15
27
  </a>
16
28
  </li>
17
29
  <li>
18
- <a class="<%= 'active' if active == 'how-government-works' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/how-government-works">
30
+ <a class="<%= 'active' if active == 'how-government-works' %> govuk-link govuk-link--no-underline govuk-link--inverse"
31
+ data-track-category="headerClicked"
32
+ data-track-action="governmentactivityLink"
33
+ data-track-label="/government/how-government-works"
34
+ data-track-dimension="<%= t("components.government_navigation.how-government-works") %>"
35
+ data-track-dimension-index="29"
36
+ href="/government/how-government-works">
19
37
  <%= t("components.government_navigation.how-government-works") %>
20
38
  </a>
21
39
  </li>
22
40
  <li>
23
- <a class="<%= 'active' if active == 'get-involved' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/get-involved">
41
+ <a class="<%= 'active' if active == 'get-involved' %> govuk-link govuk-link--no-underline govuk-link--inverse"
42
+ data-track-category="headerClicked"
43
+ data-track-action="governmentactivityLink"
44
+ data-track-label="/government/get-involved"
45
+ data-track-dimension="<%= t("components.government_navigation.get-involved") %>"
46
+ data-track-dimension-index="29"
47
+ href="/government/get-involved">
24
48
  <%= t("components.government_navigation.get-involved") %>
25
49
  </a>
26
50
  </li>
27
51
  <li class="clear-child">
28
- <a class="<%= 'active' if active == 'consultations' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="<%= CGI::escapeHTML('/search/policy-papers-and-consultations?content_store_document_type[]=open_consultations&content_store_document_type[]=closed_consultations') %>">
52
+ <a class="<%= 'active' if active == 'consultations' %> govuk-link govuk-link--no-underline govuk-link--inverse"
53
+ data-track-category="headerClicked"
54
+ data-track-action="governmentactivityLink"
55
+ data-track-label="/government/get-involved"
56
+ data-track-dimension="<%= t("components.government_navigation.consultations") %>"
57
+ data-track-dimension-index="29"
58
+ href="<%= CGI::escapeHTML('/search/policy-papers-and-consultations?content_store_document_type[]=open_consultations&content_store_document_type[]=closed_consultations') %>">
29
59
  <%= t("components.government_navigation.consultations") %>
30
60
  </a>
31
61
  </li>
32
62
  <li>
33
- <a class="<%= 'active' if active == 'statistics' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/search/research-and-statistics">
63
+ <a class="<%= 'active' if active == 'statistics' %> govuk-link govuk-link--no-underline govuk-link--inverse"
64
+ data-track-category="headerClicked"
65
+ data-track-action="governmentactivityLink"
66
+ data-track-label="/government/research-and-statistics"
67
+ data-track-dimension="<%= t("components.government_navigation.statistics") %>"
68
+ data-track-dimension-index="29"
69
+ href="/search/research-and-statistics">
34
70
  <%= t("components.government_navigation.statistics") %>
35
71
  </a>
36
72
  </li>
37
73
  <li>
38
- <a class="<%= 'active' if active == 'announcements' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/news-and-communications">
74
+ <a class="<%= 'active' if active == 'announcements' %> govuk-link govuk-link--no-underline govuk-link--inverse"
75
+ data-track-category="headerClicked"
76
+ data-track-action="governmentactivityLink"
77
+ data-track-label="/search/news-and-communications"
78
+ data-track-dimension="<%= t("components.government_navigation.news_and_communications") %>"
79
+ data-track-dimension-index="29"
80
+ href="/search/news-and-communications">
39
81
  <%= t("components.government_navigation.news_and_communications") %>
40
82
  </a>
41
83
  </li>
@@ -4,6 +4,7 @@
4
4
  global_bar ||= nil
5
5
  html_lang ||= "en"
6
6
  layout_helper = GovukPublishingComponents::Presenters::PublicLayoutHelper.new(local_assigns)
7
+ logo_link ||= "/"
7
8
  navigation_items ||= []
8
9
  omit_header ||= false
9
10
  show_search = local_assigns.include?(:show_search) ? local_assigns[:show_search] : true
@@ -71,6 +72,7 @@
71
72
  <% unless omit_header %>
72
73
  <%= render "govuk_publishing_components/components/layout_header", {
73
74
  search: show_search,
75
+ logo_link: logo_link,
74
76
  navigation_items: navigation_items,
75
77
 
76
78
  # The (blue) bottom border needs to be underneath the emergency banner -
@@ -8,6 +8,7 @@
8
8
  search ||= false
9
9
  search_left ||= false
10
10
  width_class = full_width ? "govuk-header__container--full-width" : "govuk-width-container"
11
+ logo_link ||= "/"
11
12
 
12
13
  header_classes = %w[gem-c-layout-header govuk-header]
13
14
  header_classes << "gem-c-layout-header--#{environment}" if environment
@@ -20,7 +21,11 @@
20
21
  <% if search_left %>
21
22
  <div class="govuk-grid-row">
22
23
  <div class="gem-c-layout-header__logo govuk-grid-column-one-third-from-desktop">
23
- <%= render "govuk_publishing_components/components/layout_header/header_logo", environment: environment, product_name: product_name %>
24
+ <%= render "govuk_publishing_components/components/layout_header/header_logo", {
25
+ environment: environment,
26
+ logo_link: logo_link,
27
+ product_name: product_name,
28
+ } %>
24
29
  </div>
25
30
  </div>
26
31
  <div class="govuk-grid-row">
@@ -36,7 +41,11 @@
36
41
  <% else %>
37
42
  <div class="govuk-grid-row">
38
43
  <div class="gem-c-layout-header__logo govuk-grid-column-two-thirds">
39
- <%= render "govuk_publishing_components/components/layout_header/header_logo", environment: environment, product_name: product_name %>
44
+ <%= render "govuk_publishing_components/components/layout_header/header_logo", {
45
+ environment: environment,
46
+ logo_link: logo_link,
47
+ product_name: product_name,
48
+ } %>
40
49
  </div>
41
50
  <% if navigation_items.any? %>
42
51
  <div class="govuk-header__content gem-c-header__content govuk-grid-column-full">
@@ -10,6 +10,9 @@
10
10
  size ||= ""
11
11
  value ||= ""
12
12
 
13
+ data_attributes ||= {}
14
+ data_attributes[:module] = 'gem-track-click'
15
+
13
16
  classes = %w[gem-c-search govuk-!-display-none-print]
14
17
  classes << (shared_helper.get_margin_top)
15
18
  classes << (shared_helper.get_margin_bottom) if local_assigns[:margin_bottom]
@@ -40,9 +43,9 @@
40
43
  value: value,
41
44
  ) %>
42
45
  <div class="gem-c-search__item gem-c-search__submit-wrapper">
43
- <button class="gem-c-search__submit" type="submit">
46
+ <%= tag.button class: "gem-c-search__submit", type: "submit", data: data_attributes do %>
44
47
  <%= button_text %>
45
- </button>
48
+ <% end %>
46
49
  </div>
47
50
  </div>
48
51
  </div>
@@ -1,6 +1,11 @@
1
1
  <% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
2
- <% link_text = t("components.related_navigation.transition.link_text") %>
3
- <% link_path = t("components.related_navigation.transition.link_path") %>
2
+ <% cta_helper = GovukPublishingComponents::Presenters::BrexitCtaHelper.new(content_item) %>
3
+ <%
4
+ title = t(cta_helper.title_key)
5
+ link_text = t(cta_helper.link_text_key)
6
+ link_path = t(cta_helper.link_path_key)
7
+ lang = shared_helper.t_locale(cta_helper.title_key)
8
+ %>
4
9
 
5
10
  <% data_attributes = {
6
11
  "module": "gem-track-click",
@@ -12,12 +17,12 @@
12
17
  } %>
13
18
 
14
19
  <%= tag.div class: "gem-c-contextual-sidebar__brexit-cta" do %>
15
- <%= tag.h2 t("components.related_navigation.transition.title"), class: "gem-c-contextual-sidebar__brexit-heading govuk-heading-s" %>
20
+ <%= tag.h2 title, class: "gem-c-contextual-sidebar__brexit-heading govuk-heading-s" %>
16
21
  <%= tag.p class: "gem-c-contextual-sidebar__brexit-text govuk-body" do %>
17
22
  <%= link_to link_text,
18
23
  link_path,
19
24
  class: "govuk-link",
20
25
  data: data_attributes,
21
- lang: shared_helper.t_locale("components.related_navigation.transition.title") %>
26
+ lang: lang %>
22
27
  <% end %>
23
28
  <% end %>
@@ -1,11 +1,11 @@
1
1
  <div class="govuk-header__logo gem-c-header__logo">
2
- <a href="/" class="govuk-header__link govuk-header__link--homepage" data-module="gem-track-click" data-track-category="homeLinkClicked" data-track-action="homeHeader">
2
+ <a href="<%= logo_link %>" class="govuk-header__link govuk-header__link--homepage" data-module="gem-track-click" data-track-category="homeLinkClicked" data-track-action="homeHeader">
3
3
  <span class="govuk-header__logotype">
4
- <svg aria-hidden="true" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 132 97" height="32" width="36">
4
+ <svg aria-hidden="true" focusable="false" class="gem-c-header__logotype-crown govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 132 97" height="32" width="36">
5
5
  <path fill="currentColor" fill-rule="evenodd"
6
6
  d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6-3.9 9.1zM89.3 35.8c-3.6 1.5-7.8-.2-9.2-3.8-1.4-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.4 3.6-.3 7.7-3.9 9.1zM69.7 17.7l8.9 4.7V9.3l-8.9 2.8c-.2-.3-.5-.6-.9-.9L72.4 0H59.6l3.5 11.2c-.3.3-.6.5-.9.9l-8.8-2.8v13.1l8.8-4.7c.3.3.6.7.9.9l-5 15.4v.1c-.2.8-.4 1.6-.4 2.4 0 4.1 3.1 7.5 7 8.1h.2c.3 0 .7.1 1 .1.4 0 .7 0 1-.1h.2c4-.6 7.1-4.1 7.1-8.1 0-.8-.1-1.7-.4-2.4V34l-5.1-15.4c.4-.2.7-.6 1-.9zM66 92.8c16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
7
7
  <%# Deliberate use of image tag as a fallback method https://lynn.ru/examples/svg/en.html %>
8
- <image src="<%= asset_path('govuk-logotype-crown.png') %>" class="govuk-header__logotype-crown-fallback-image"></image>
8
+ <image src="<%= asset_path('govuk-logotype-crown.png') %>" xlink:href="" display="none" class="govuk-header__logotype-crown-fallback-image" width="36" height="32"></image>
9
9
  </svg>
10
10
  <span class="govuk-header__logotype-text">
11
11
  GOV.UK
@@ -116,6 +116,9 @@ ar:
116
116
  topical_events:
117
117
  topics:
118
118
  transition:
119
+ hub_page_link_path:
120
+ hub_page_link_text:
121
+ hub_page_title:
119
122
  link_path:
120
123
  link_text:
121
124
  title:
@@ -116,6 +116,9 @@ az:
116
116
  topical_events:
117
117
  topics:
118
118
  transition:
119
+ hub_page_link_path:
120
+ hub_page_link_text:
121
+ hub_page_title:
119
122
  link_path:
120
123
  link_text:
121
124
  title:
@@ -116,6 +116,9 @@ be:
116
116
  topical_events:
117
117
  topics:
118
118
  transition:
119
+ hub_page_link_path:
120
+ hub_page_link_text:
121
+ hub_page_title:
119
122
  link_path:
120
123
  link_text:
121
124
  title: