govuk_publishing_components 34.0.0 → 34.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (145) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/images/govuk_publishing_components/icon-search.svg +3 -0
  3. data/app/assets/images/govuk_publishing_components/youtube-play-icon.png +0 -0
  4. data/app/assets/images/govuk_publishing_components/youtube-play-icon.svg +4 -0
  5. data/app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js +2 -1
  6. data/app/assets/javascripts/govuk_publishing_components/analytics/linked-domains.js +135 -0
  7. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +1 -40
  8. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +2 -0
  9. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +4 -4
  10. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +0 -1
  11. data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +2 -2
  12. data/app/assets/javascripts/govuk_publishing_components/components/image-card.js +19 -0
  13. data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +12 -69
  14. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +14 -13
  15. data/app/assets/javascripts/govuk_publishing_components/dependencies.js +3 -0
  16. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +3 -2
  17. data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +209 -0
  18. data/app/assets/javascripts/govuk_publishing_components/modules.js +7 -2
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +15 -19
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +82 -1
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +247 -412
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +0 -1
  24. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +26 -9
  25. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +2 -2
  26. data/app/controllers/govuk_publishing_components/application_controller.rb +0 -13
  27. data/app/controllers/govuk_publishing_components/audit_controller.rb +1 -1
  28. data/app/models/govuk_publishing_components/audit_comparer.rb +1 -1
  29. data/app/models/govuk_publishing_components/audit_components.rb +103 -82
  30. data/app/views/govuk_publishing_components/audit/_applications.html.erb +1 -1
  31. data/app/views/govuk_publishing_components/audit/_component_contents.html.erb +47 -39
  32. data/app/views/govuk_publishing_components/audit/_components.html.erb +1 -1
  33. data/app/views/govuk_publishing_components/components/_accordion.html.erb +2 -2
  34. data/app/views/govuk_publishing_components/components/_contextual_footer.html.erb +2 -0
  35. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +7 -3
  36. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +10 -6
  37. data/app/views/govuk_publishing_components/components/_error_message.html.erb +2 -1
  38. data/app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb +2 -2
  39. data/app/views/govuk_publishing_components/components/_hint.html.erb +2 -1
  40. data/app/views/govuk_publishing_components/components/_image_card.html.erb +12 -9
  41. data/app/views/govuk_publishing_components/components/_input.html.erb +8 -2
  42. data/app/views/govuk_publishing_components/components/_label.html.erb +5 -3
  43. data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +2 -2
  44. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +6 -2
  45. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +125 -145
  46. data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +12 -6
  47. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
  48. data/app/views/govuk_publishing_components/components/_textarea.html.erb +10 -2
  49. data/app/views/govuk_publishing_components/components/docs/contextual_footer.yml +43 -0
  50. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +58 -0
  51. data/app/views/govuk_publishing_components/components/docs/emergency_banner.yml +3 -1
  52. data/app/views/govuk_publishing_components/components/docs/error_message.yml +13 -0
  53. data/app/views/govuk_publishing_components/components/docs/hint.yml +6 -0
  54. data/app/views/govuk_publishing_components/components/docs/image_card.yml +24 -1
  55. data/app/views/govuk_publishing_components/components/docs/input.yml +32 -0
  56. data/app/views/govuk_publishing_components/components/docs/intervention.yml +2 -1
  57. data/app/views/govuk_publishing_components/components/docs/label.yml +17 -0
  58. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +1 -0
  59. data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +2 -0
  60. data/app/views/govuk_publishing_components/components/docs/related_navigation.yml +27 -0
  61. data/app/views/govuk_publishing_components/components/docs/textarea.yml +31 -0
  62. data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +2 -0
  63. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +2 -2
  64. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +1 -2
  65. data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +4 -2
  66. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +18 -8
  67. data/app/views/layouts/govuk_publishing_components/application.html.erb +2 -2
  68. data/config/locales/ar.yml +14 -7
  69. data/config/locales/az.yml +14 -7
  70. data/config/locales/be.yml +14 -7
  71. data/config/locales/bg.yml +14 -7
  72. data/config/locales/bn.yml +14 -7
  73. data/config/locales/cs.yml +14 -7
  74. data/config/locales/cy.yml +14 -7
  75. data/config/locales/da.yml +14 -7
  76. data/config/locales/de.yml +14 -7
  77. data/config/locales/dr.yml +14 -7
  78. data/config/locales/el.yml +14 -7
  79. data/config/locales/en.yml +18 -18
  80. data/config/locales/es-419.yml +14 -7
  81. data/config/locales/es.yml +14 -7
  82. data/config/locales/et.yml +14 -7
  83. data/config/locales/fa.yml +14 -7
  84. data/config/locales/fi.yml +14 -7
  85. data/config/locales/fr.yml +14 -7
  86. data/config/locales/gd.yml +14 -7
  87. data/config/locales/gu.yml +14 -7
  88. data/config/locales/he.yml +14 -7
  89. data/config/locales/hi.yml +14 -7
  90. data/config/locales/hr.yml +14 -7
  91. data/config/locales/hu.yml +14 -7
  92. data/config/locales/hy.yml +14 -7
  93. data/config/locales/id.yml +14 -7
  94. data/config/locales/is.yml +14 -7
  95. data/config/locales/it.yml +14 -7
  96. data/config/locales/ja.yml +14 -7
  97. data/config/locales/ka.yml +14 -7
  98. data/config/locales/kk.yml +14 -7
  99. data/config/locales/ko.yml +14 -7
  100. data/config/locales/lt.yml +14 -7
  101. data/config/locales/lv.yml +14 -7
  102. data/config/locales/ms.yml +14 -7
  103. data/config/locales/mt.yml +14 -7
  104. data/config/locales/nl.yml +14 -7
  105. data/config/locales/no.yml +14 -7
  106. data/config/locales/pa-pk.yml +14 -7
  107. data/config/locales/pa.yml +14 -7
  108. data/config/locales/pl.yml +14 -7
  109. data/config/locales/ps.yml +14 -7
  110. data/config/locales/pt.yml +14 -7
  111. data/config/locales/ro.yml +14 -7
  112. data/config/locales/ru.yml +14 -7
  113. data/config/locales/si.yml +14 -7
  114. data/config/locales/sk.yml +14 -7
  115. data/config/locales/sl.yml +14 -7
  116. data/config/locales/so.yml +14 -7
  117. data/config/locales/sq.yml +14 -7
  118. data/config/locales/sr.yml +14 -7
  119. data/config/locales/sv.yml +14 -7
  120. data/config/locales/sw.yml +14 -7
  121. data/config/locales/ta.yml +14 -7
  122. data/config/locales/th.yml +14 -7
  123. data/config/locales/tk.yml +14 -7
  124. data/config/locales/tr.yml +14 -7
  125. data/config/locales/uk.yml +14 -7
  126. data/config/locales/ur.yml +14 -7
  127. data/config/locales/uz.yml +14 -7
  128. data/config/locales/vi.yml +14 -7
  129. data/config/locales/zh-hk.yml +14 -7
  130. data/config/locales/zh-tw.yml +14 -7
  131. data/config/locales/zh.yml +14 -7
  132. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +65 -2
  133. data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +1 -1
  134. data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +4 -0
  135. data/lib/govuk_publishing_components/version.rb +1 -1
  136. data/node_modules/axe-core/README.md +1 -1
  137. data/node_modules/axe-core/axe.d.ts +76 -24
  138. data/node_modules/axe-core/axe.js +4903 -4648
  139. data/node_modules/axe-core/axe.min.js +3 -3
  140. data/node_modules/axe-core/package.json +28 -28
  141. data/node_modules/axe-core/sri-history.json +16 -0
  142. data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +5 -0
  143. data/node_modules/govuk-frontend/package.json +1 -1
  144. metadata +9 -4
  145. data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +0 -28
@@ -103,3 +103,61 @@ examples:
103
103
  title: "Russian invasion of Ukraine: UK government response"
104
104
  base_path: "/government/topical-events/russian-invasion-of-ukraine-uk-government-response"
105
105
  locale: "en"
106
+ with_ga4_tracking_on_related_navigation:
107
+ description: Adds Google Analytics 4 tracking to components within the sidebar. Currently only the Related Navigation and Step by Step navigation components accept this option.
108
+ data:
109
+ ga4_tracking: true
110
+ content_item:
111
+ title: "UK forces arrive to reinforce NATO’s eastern flank"
112
+ content_id: "a342fd46-d801-4c1e-9d8f-f41fba6da563"
113
+ locale: "en"
114
+ links:
115
+ ordered_related_items:
116
+ - title: Find an apprenticeship
117
+ base_path: /apply-apprenticeship
118
+ - title: Careers helpline for teenagers
119
+ base_path: /careers-helpline-for-teenagers
120
+ document_collections:
121
+ - title: Recruit an apprentice (formerly apprenticeship vacancies)
122
+ base_path: /government/collections/apprenticeship-vacancies
123
+ document_type: document_collection
124
+ - title: The future of jobs and skills
125
+ base_path: /government/collections/the-future-of-jobs-and-skills
126
+ document_type: document_collection
127
+ with_ga4_tracking_on_step_by_step:
128
+ description: Adds Google Analytics 4 tracking to components within the sidebar. Currently only the Related Navigation and Step by Step navigation components accept this option.
129
+ data:
130
+ ga4_tracking: true
131
+ content_item:
132
+ title: "A content item"
133
+ links:
134
+ part_of_step_navs:
135
+ - title: "Learn to drive a car: step by step"
136
+ base_path: "/micropigs-vs-micropugs"
137
+ details:
138
+ step_by_step_nav:
139
+ title: 'Stay in the UK after it leaves the EU (''settled status''): step by step'
140
+ steps:
141
+ - title: Check you're allowed to drive
142
+ contents:
143
+ - type: paragraph
144
+ text: Most people can start learning to drive when they’re 17.
145
+ - type: list
146
+ contents:
147
+ - text: Check what age you can drive
148
+ href: "/vehicles-can-drive"
149
+ optional: false
150
+ - title: Testing the and
151
+ logic: and
152
+ contents:
153
+ - type: paragraph
154
+ text: hello hello what's UP
155
+ - title: Driving lessons and practice
156
+ contents:
157
+ - type: paragraph
158
+ text: You need a provisional driving licence to take lessons or practice.
159
+ - type: list
160
+ contents:
161
+ - text: The Highway Code
162
+ href: "/guidance/the-highway-code"
163
+ optional: false
@@ -7,7 +7,9 @@ body: |
7
7
 
8
8
  shared_accessibility_criteria:
9
9
  - link
10
-
10
+ accessibility_excluded_rules:
11
+ - duplicate-id-aria # IDs will be duplicated in component examples list
12
+ - landmark-unique # aria-label attributes will be duplicated in component examples list
11
13
  examples:
12
14
  default:
13
15
  description: |
@@ -21,3 +21,16 @@ examples:
21
21
  items:
22
22
  - text: Error 1
23
23
  - text: Error 2
24
+ with_dir_attribute:
25
+ description: Allows the correct display of right to left languages
26
+ data:
27
+ text: "An error message displayed right to left"
28
+ id: "error_id_2"
29
+ right_to_left: true
30
+ with_items_and_dir_attribute:
31
+ description: To allow the correct display of right to left languages on error items
32
+ data:
33
+ right_to_left: true
34
+ items:
35
+ - text: Error 1 displayed right to left
36
+ - text: Error 2 displayed right to left
@@ -19,3 +19,9 @@ examples:
19
19
  data:
20
20
  text: "You qualify if you were born in the UK before June 1960."
21
21
  margin_bottom: 9
22
+ with_dir_attribute:
23
+ description: |
24
+ Allows the correct display of right to left languages.
25
+ data:
26
+ text: "العربيَّة"
27
+ right_to_left: true
@@ -205,6 +205,29 @@ examples:
205
205
  <div class="govuk-!-width-full">
206
206
  <%= component %>
207
207
  </div>
208
+ youtube_video:
209
+ description: |
210
+ Given a Youtube video id, the image card will render a Youtube embed instead of an image. If Javascript fails to execute for any reason, then a fallback link to the Youtube video will be rendered instead.
211
+
212
+ Youtube does not support embeds on Internet Explorer versions lower than 10. In addition, Youtube's website will block any version of Internet Explorer using it. There is therefore no fallback for IE9 and lower.
213
+ data:
214
+ youtube_video_id: "XnP6jaK7ZAY"
215
+ href: "/still-not-a-page"
216
+ youtube_video_alt: "The vision for GOV.UK"
217
+ context:
218
+ date: 2017-06-14 11:30:00
219
+ text: "Announcement"
220
+ description: "Following a news report that something has happened, further details are emerging of the thing that has happened and what that means for you."
221
+ extra_details: [
222
+ {
223
+ text: "Link to video transcript",
224
+ href: "/1"
225
+ }
226
+ ]
227
+ embed: |
228
+ <div class="govuk-!-width-full">
229
+ <%= component %>
230
+ </div>
208
231
  with_data_attributes:
209
232
  description: Data attributes can be applied as required. Note that the component does not include built in tracking. If this is required consider using the [track click script](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics/track-click.md).
210
233
  data:
@@ -296,4 +319,4 @@ examples:
296
319
  embed: |
297
320
  <div class="govuk-!-width-full">
298
321
  <%= component %>
299
- </div>
322
+ </div>
@@ -183,3 +183,35 @@ examples:
183
183
  text: "Given name"
184
184
  name: given-name
185
185
  enterkeyhint: "next"
186
+ with_dir_attribute:
187
+ description: |
188
+ Allows the correct display of right to left languages.
189
+
190
+ By default the input element and the label both display text in a left to right direction.
191
+
192
+ When the `right_to_left` parameter of the input component is set to `true` both the input and the label, hint and error message display their content in a right to left direction.
193
+ data:
194
+ label:
195
+ text: "Some input text to be displayed right to left with a label that displays in the same direction"
196
+ hint: "Some hint text that displays in the same text direction as the label"
197
+ error_message: "An error message that displays in the same text direction as the label"
198
+ name: rtl-input-text
199
+ value: "العربيَّة"
200
+ right_to_left: true
201
+
202
+ with_separate_dir_attributes_for_field_and_help_text:
203
+ description: |
204
+ Allows the correct display of right to left languages.
205
+
206
+ By default the input element and the label both display text in a left to right direction.
207
+
208
+ If the input field and the help text (label, hint and error messages) are required to display in different directions the `right_to_left_help` attribute can be set as false to override the `right_to_left` attribute.
209
+ data:
210
+ label:
211
+ text: "Some input text that displays right to left with a label that displays left to right"
212
+ hint: "Some hint text that displays in the same text direction as the label"
213
+ name: rtl-input-text
214
+ value: "العربيَّة"
215
+ right_to_left: true
216
+ right_to_left_help: false
217
+ error_message: "An error message that displays in the same text direction as the label"
@@ -14,9 +14,10 @@ accessibility_criteria: |
14
14
  - have a border colour contrast ratio of more than 4.5:1 with its background to be visually distinct
15
15
  - prevent screen readers from announcing the dismiss link icon
16
16
 
17
-
18
17
  shared_accessibility_criteria:
19
18
  - link
19
+ accessibility_excluded_rules:
20
+ - landmark-unique # aria-label attributes will be duplicated in component examples list
20
21
  examples:
21
22
  default:
22
23
  data:
@@ -59,3 +59,20 @@ examples:
59
59
  html_for: "id-radio"
60
60
  hint_id: "id-radio"
61
61
  hint_text: "It’s on your National Insurance card, benefit letter, payslip or P60. For example, ‘QQ 12 34 56 C’."
62
+ with_id:
63
+ description:
64
+ data:
65
+ text: "Label with an ID"
66
+ id: "id-for-the-label"
67
+ html_for: "id-that-matches-input-6"
68
+ with_dir_attribute:
69
+ description: |
70
+ To allow the correct display of right to left languages.
71
+
72
+ When the `right_to_left` parameter is set to `true` any hint text displays in the same text direction as the label.
73
+ data:
74
+ text: "العربيَّة"
75
+ html_for: "id-that-matches-input-7"
76
+ hint_id: "should-match-aria-describedby-input"
77
+ hint_text: "Hint text displayed right to left"
78
+ right_to_left: true
@@ -7,6 +7,7 @@ govuk_frontend_components:
7
7
  - header
8
8
  accessibility_excluded_rules:
9
9
  - landmark-banner-is-top-level # The header element can not be top level in the examples
10
+ - duplicate-id # IDs will be duplicated in component examples list
10
11
  - duplicate-id-aria # IDs will be duplicated in component examples list
11
12
  - form-field-multiple-labels # Form labels will be ambiguous in component examples list
12
13
  - landmark-no-duplicate-banner # banners will be duplicated in component examples list
@@ -21,6 +21,8 @@ accessibility_criteria: |
21
21
 
22
22
  shared_accessibility_criteria:
23
23
  - link
24
+ accessibility_excluded_rules:
25
+ - landmark-unique # aria-label attributes will be duplicated in component examples list
24
26
  examples:
25
27
  default:
26
28
  data:
@@ -306,3 +306,30 @@ examples:
306
306
  title: "Student loans: terms and conditions 2017 to 2018 (PDF, 136KB)"
307
307
  - title: The Student Room repaying your student loan
308
308
  url: https://www.thestudentroom.co.uk/content.php?r=5967-Repaying-your-student-loan
309
+ with_ga4_tracking:
310
+ description: Adds Google Analytics 4 tracking to the component, using the [GA4 link tracker](https://github.com/alphagov/govuk_publishing_components/blob/main/docs/analytics-ga4/ga4-link-tracker.md).
311
+ data:
312
+ ga4_tracking: true
313
+ content_item:
314
+ links:
315
+ ordered_related_items:
316
+ - title: Find an apprenticeship
317
+ base_path: /apply-apprenticeship
318
+ - title: Training and study at work
319
+ base_path: /training-study-work-your-rights
320
+ - title: Careers helpline for teenagers
321
+ base_path: /careers-helpline-for-teenagers
322
+ topics:
323
+ - title: Apprenticeships, 14 to 19 education and training for work
324
+ base_path: /browse/education/find-course
325
+ document_type: topic
326
+ - title: Finding a job
327
+ base_path: /browse/working/finding-job
328
+ document_type: topic
329
+ - title: Apprenticeships
330
+ base_path: /topic/further-education-skills/apprenticeships
331
+ document_type: topic
332
+ topical_events:
333
+ - title: UK-China High-Level People to People Dialogue 2017
334
+ base_path: /government/topical-events/uk-china-high-level-people-to-people-dialogue-2017
335
+ document_type: topical_event
@@ -110,3 +110,34 @@ examples:
110
110
  name: "with_data_attrbutes"
111
111
  data:
112
112
  module: "some-awesome-module-here"
113
+ with_dir_attribute:
114
+ description: |
115
+ Allows the correct display of right to left languages.
116
+
117
+ By default the textarea element and the label both display text in a left to right direction.
118
+
119
+ When the `right_to_left` parameter of the textarea component is set to `true` all text desplays in a right to left direction.
120
+ data:
121
+ label:
122
+ text: "Some textarea text that displays right to left with a label that displays in the same direction"
123
+ hint: "Some hint text that displays in the same text direction as the label"
124
+ error_message: "An error message that displays in the same text direction as the label"
125
+ name: "rtl-textarea-text"
126
+ value: "العربيَّة"
127
+ right_to_left: true
128
+ with_separate_dir_attributes_for_field_and_help_text:
129
+ description: |
130
+ Allows the correct display of right to left languages.
131
+
132
+ By default the textarea element and the label both display text in a left to right direction.
133
+
134
+ If the textarea field and the help text (label, hint and error messages) are required to display in different directions the right_to_left_help attribute can be set as false to override the right_to_left attribute.
135
+ data:
136
+ label:
137
+ text: "Some textarea text that displays right to left with a label that displays left to right"
138
+ hint: "Some hint text that displays in the same text direction as the label"
139
+ error_message: "An error message that displays in the same text direction as the label"
140
+ name: rtl-textarea-text
141
+ value: "العربيَّة"
142
+ right_to_left: true
143
+ right_to_left_help: false
@@ -14,6 +14,8 @@ accessibility_criteria: |
14
14
  [Watch a screen reader pronounce text differently based on lang attribute](https://bit.ly/screenreaderpronunciation)
15
15
  shared_accessibility_criteria:
16
16
  - link
17
+ accessibility_excluded_rules:
18
+ - landmark-unique # aria-label attributes will be duplicated in component examples list
17
19
  examples:
18
20
  default:
19
21
  data:
@@ -68,7 +68,7 @@
68
68
  # This seems to be a more reliable way to make sure the script is executed.
69
69
  %>
70
70
 
71
- <script>
71
+ <%= javascript_tag nonce: true do -%>
72
72
  document.addEventListener("DOMContentLoaded", function () {
73
73
  var input = document.querySelector("#giraffe"),
74
74
  form = document.querySelector("#something-is-wrong")
@@ -80,4 +80,4 @@
80
80
  e.preventDefault();
81
81
  }
82
82
  });
83
- </script>
83
+ <% end -%>
@@ -4,7 +4,7 @@
4
4
  <div class="gem-c-feedback__prompt-question-answer">
5
5
  <h2 class="gem-c-feedback__prompt-question"><%= t("components.feedback.is_this_page_useful") %></h2>
6
6
  <ul class="gem-c-feedback__option-list">
7
- <li class="gem-c-feedback__option-list-item govuk-visually-hidden" style="display: none" hidden>
7
+ <li class="gem-c-feedback__option-list-item govuk-visually-hidden" hidden>
8
8
  <% # Maybe button exists only to try and capture clicks by bots %>
9
9
  <%= link_to "/contact/govuk", {
10
10
  class: 'gem-c-feedback__prompt-link',
@@ -13,7 +13,6 @@
13
13
  'track-action' => 'ffMaybeClick'
14
14
  },
15
15
  role: 'button',
16
- style: 'display: none',
17
16
  hidden: 'hidden',
18
17
  'aria-hidden': 'true',
19
18
  } do %>
@@ -13,8 +13,10 @@
13
13
  class="gem-c-metadata__definition-link govuk-!-display-none-print"
14
14
  data-controls="toggle-<%= toggle_id %>"
15
15
  data-expanded="false"
16
- data-toggled-text="<%= t("components.metadata.toggle_less") %>">
17
- <%= t("components.metadata.toggle_more", number: remaining.length) %>
16
+ data-toggled-text="<%= t("common.toggle_less") %>">
17
+ <%= t("common.toggle_more",
18
+ show: t('common.show'),
19
+ number: remaining.length) %>
18
20
  </a>
19
21
  </div>
20
22
  <span id="toggle-<%= toggle_id %>" class="gem-c-metadata__toggle-items js-hidden"><%= remaining.to_sentence.html_safe %></span>
@@ -3,20 +3,23 @@
3
3
  aria-labelledby="related-nav-<%= section_title %>-<%= random %>"
4
4
  data-module="gem-toggle">
5
5
 
6
- <% unless section_title === "related_items" %>
6
+ <% if section_title === "related_items" %>
7
+ <% heading_text = related_nav_helper.component_title %>
8
+ <% else %>
7
9
  <%=
8
10
  heading_class = related_nav_helper.section_css_class("gem-c-related-navigation__sub-heading", section_title)
9
11
  heading_data = { 'track-count' => related_nav_helper.section_data_track_count(:related_item_section) }
10
12
  heading_id = "related-nav-#{section_title}-#{random}"
11
13
  heading_level = related_nav_helper.section_heading_level
14
+ heading_text = related_nav_helper.construct_section_heading(section_title)
12
15
 
13
16
  content_tag(heading_level, id: heading_id, class: heading_class, data: heading_data) do
14
- related_nav_helper.construct_section_heading(section_title)
17
+ heading_text
15
18
  end
16
19
  %>
17
20
  <% end %>
18
21
 
19
- <ul class="gem-c-related-navigation__link-list" data-module="gem-track-click">
22
+ <ul class="gem-c-related-navigation__link-list">
20
23
  <% constructed_link_array = [] %>
21
24
 
22
25
  <% section_link_limit = related_nav_helper.calculate_section_link_limit(links) %>
@@ -24,6 +27,12 @@
24
27
  <% links.each.with_index(1) do |link, index| %>
25
28
  <%
26
29
  link_class = "govuk-link #{related_nav_helper.section_css_class("govuk-link gem-c-related-navigation__section-link", section_title, link: link, link_is_inline: (index >= section_link_limit))}"
30
+ ga4_attributes = {
31
+ event_name: "navigation",
32
+ type: "related content",
33
+ index: "#{section_index}.#{index}",
34
+ section: heading_text,
35
+ } if ga4_tracking
27
36
  link_element = link_to(
28
37
  link[:text],
29
38
  link[:path],
@@ -37,7 +46,8 @@
37
46
  track_options: {
38
47
  dimension28: links.length.to_s,
39
48
  dimension29: link[:text]
40
- }
49
+ },
50
+ ga4_link: ga4_attributes,
41
51
  }
42
52
  )
43
53
  %>
@@ -54,10 +64,10 @@
54
64
  class="gem-c-related-navigation__toggle"
55
65
  data-controls="toggle_<%= section_title %>"
56
66
  data-expanded="false"
57
- data-toggled-text="<%= t("components.metadata.toggle_less") %>">
58
- <%= t("components.metadata.toggle_more",
59
- number: related_nav_helper.remaining_link_count(links),
60
- default: "+ #{related_nav_helper.remaining_link_count(links)} more") %>
67
+ data-toggled-text="<%= t("common.toggle_less") %>">
68
+ <%= t("common.toggle_more",
69
+ show: t('common.show'),
70
+ number: related_nav_helper.remaining_link_count(links)) %>
61
71
  </a>
62
72
  </li>
63
73
 
@@ -23,9 +23,9 @@
23
23
  <%= yield :extra_headers %>
24
24
  </head>
25
25
  <body class="gem-c-layout-for-admin govuk-template__body <%= 'hide-header-and-footer' if @preview %>">
26
- <script>
26
+ <%= javascript_tag nonce: true do -%>
27
27
  document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
28
- </script>
28
+ <% end -%>
29
29
  <% if @preview %>
30
30
  <main id="wrapper" class="govuk-width-container">
31
31
  <%= yield %>
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  ar:
3
3
  common:
4
+ hide: إخفاء
5
+ show: إظهار
6
+ toggle_less: عرض أقل
7
+ toggle_more: زيادة بمقدار %{show} %{number}
4
8
  translations: الترجمات
5
9
  components:
6
10
  accordion:
7
- hide: إخفاء
8
11
  hide_all: إخفاء كل الأقسام
9
- show: إظهار
10
12
  show_all: إظهار كل الأقسام
11
13
  this_section_visually_hidden: " هذا القسم"
12
14
  article_schema:
@@ -42,8 +44,12 @@ ar:
42
44
  buttons:
43
45
  accept_cookies: قبول ملفات تعريف الارتباط الإضافية
44
46
  reject_cookies: رفض ملفات تعريف الارتباط الإضافية
45
- confirmation_message_html: يمكنك %{link} في أي وقت.
46
- confirmation_message_link: قم بتغيير إعدادات ملفات تعريف الارتباط الخاصة بك
47
+ view_cookies:
48
+ confirmation_message:
49
+ accepted:
50
+ html: يمكنك %{link} في أي وقت.
51
+ link: قم بتغيير إعدادات ملفات تعريف الارتباط الخاصة بك
52
+ rejected:
47
53
  hide: إخفاء هذه الرسالة
48
54
  text:
49
55
  - نحن نستخدم بعض ملفات تعريف الارتباط الأساسية لجعل هذا الموقع يعمل.
@@ -112,7 +118,10 @@ ar:
112
118
  menu_toggle_label:
113
119
  hide:
114
120
  show:
115
- navigation_links:
121
+ navigation_link:
122
+ href:
123
+ label:
124
+ navigation_links_columns:
116
125
  navigation_menu_heading:
117
126
  navigation_search_heading:
118
127
  navigation_search_subheading:
@@ -126,8 +135,6 @@ ar:
126
135
  part_of: جزء من
127
136
  published: منشورة
128
137
  see_all_updates: اطلع على كل التحديثات
129
- toggle_less: عرض أقل
130
- toggle_more: زيادة بمقدار + %{number}
131
138
  modal_dialogue:
132
139
  close_modal: إغلاق مربع الحوار المشروط
133
140
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  az:
3
3
  common:
4
+ hide: Gizlət
5
+ show: Göstər
6
+ toggle_less: Daha azını göstər
7
+ toggle_more: "%{show} %{number} daha çox"
4
8
  translations: Tərcümələr
5
9
  components:
6
10
  accordion:
7
- hide: Gizlət
8
11
  hide_all: Bütün bölmələri gizlət
9
- show: Göstər
10
12
  show_all: Bütün bölmələri göstər
11
13
  this_section_visually_hidden: " bu bölmə"
12
14
  article_schema:
@@ -38,8 +40,12 @@ az:
38
40
  buttons:
39
41
  accept_cookies: Əlavə kukilər qəbul edin
40
42
  reject_cookies: Əlavə kukilərdən imtina edin
41
- confirmation_message_html: İstənilən vaxt %{link}.
42
- confirmation_message_link: Kuki parametrlərinizi dəyişdirin
43
+ view_cookies:
44
+ confirmation_message:
45
+ accepted:
46
+ html: İstənilən vaxt %{link}.
47
+ link: Kuki parametrlərinizi dəyişdirin
48
+ rejected:
43
49
  hide: Bu mesajı gizlət
44
50
  text:
45
51
  - Biz bu vebsaytın işləməsini təmin etmək üçün bəzi zəruri kukilərdən istifadə edirik.
@@ -109,7 +115,10 @@ az:
109
115
  menu_toggle_label:
110
116
  hide:
111
117
  show:
112
- navigation_links:
118
+ navigation_link:
119
+ href:
120
+ label:
121
+ navigation_links_columns:
113
122
  navigation_menu_heading:
114
123
  navigation_search_heading:
115
124
  navigation_search_subheading:
@@ -123,8 +132,6 @@ az:
123
132
  part_of: Hissə
124
133
  published: Dərc edilib
125
134
  see_all_updates: Bütün yeniləmələrə baxın
126
- toggle_less: Daha azını göstər
127
- toggle_more: "+ %{number} daha çox"
128
135
  modal_dialogue:
129
136
  close_modal: Modal dialoqu bağla
130
137
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  be:
3
3
  common:
4
+ hide: Схаваць
5
+ show: Паказаць
6
+ toggle_less: Паказаць меньш
7
+ toggle_more: "%{show} %{number} болей"
4
8
  translations: Пераклады
5
9
  components:
6
10
  accordion:
7
- hide: Схаваць
8
11
  hide_all: Схаваць усе секцыi
9
- show: Паказаць
10
12
  show_all: Паказаць усе секцыi
11
13
  this_section_visually_hidden: " гэта секцыя"
12
14
  article_schema:
@@ -40,8 +42,12 @@ be:
40
42
  buttons:
41
43
  accept_cookies: Прыняць дадатковыя файлы cookie
42
44
  reject_cookies: Адхіліць дадатковыя файлы cookie
43
- confirmation_message_html: Вы можаце %{link} у любы час.
44
- confirmation_message_link: змяніць налады файлаў cookie
45
+ view_cookies:
46
+ confirmation_message:
47
+ accepted:
48
+ html: Вы можаце %{link} у любы час.
49
+ link: змяніць налады файлаў cookie
50
+ rejected:
45
51
  hide: Схаваць гэта паведамленне
46
52
  text:
47
53
  - Мы выкарыстоўваем некаторыя асноўныя файлы cookie для забеспячэння працы гэтага сайта.
@@ -115,7 +121,10 @@ be:
115
121
  menu_toggle_label:
116
122
  hide:
117
123
  show:
118
- navigation_links:
124
+ navigation_link:
125
+ href:
126
+ label:
127
+ navigation_links_columns:
119
128
  navigation_menu_heading:
120
129
  navigation_search_heading:
121
130
  navigation_search_subheading:
@@ -129,8 +138,6 @@ be:
129
138
  part_of: Частка
130
139
  published: Апублікаваны
131
140
  see_all_updates: Паглядзець усе абнаўленні
132
- toggle_less: Паказаць меньш
133
- toggle_more: "+ %{number} болей"
134
141
  modal_dialogue:
135
142
  close_modal: Зачыніць мадальны дыялог
136
143
  notice:
@@ -1,12 +1,14 @@
1
1
  ---
2
2
  bg:
3
3
  common:
4
+ hide: Скриване
5
+ show: Показване
6
+ toggle_less: Показване на по-малко
7
+ toggle_more: "%{show} %{number} повече"
4
8
  translations: Translations
5
9
  components:
6
10
  accordion:
7
- hide: Скриване
8
11
  hide_all: Скриване на всички раздели
9
- show: Показване
10
12
  show_all: Показване на всички раздели
11
13
  this_section_visually_hidden: " този раздел"
12
14
  article_schema:
@@ -38,8 +40,12 @@ bg:
38
40
  buttons:
39
41
  accept_cookies: Приемане на допълнителни бисквитки
40
42
  reject_cookies: Отказване от допълнителни бисквитки
41
- confirmation_message_html: Можете да %{link} по всяко време.
42
- confirmation_message_link: Промяна на настройките за бисквитките
43
+ view_cookies:
44
+ confirmation_message:
45
+ accepted:
46
+ html: Можете да %{link} по всяко време.
47
+ link: Промяна на настройките за бисквитките
48
+ rejected:
43
49
  hide: Скриване на това съобщение
44
50
  text:
45
51
  - Използваме някои основни бисквитки
@@ -113,7 +119,10 @@ bg:
113
119
  menu_toggle_label:
114
120
  hide:
115
121
  show:
116
- navigation_links:
122
+ navigation_link:
123
+ href:
124
+ label:
125
+ navigation_links_columns:
117
126
  navigation_menu_heading:
118
127
  navigation_search_heading:
119
128
  navigation_search_subheading:
@@ -127,8 +136,6 @@ bg:
127
136
  part_of: Част от
128
137
  published: Публикуван
129
138
  see_all_updates: Вижте всички актуализации
130
- toggle_less: Показване на по-малко
131
- toggle_more: "+ %{number} повече"
132
139
  modal_dialogue:
133
140
  close_modal: Затваряне на модалния диалог
134
141
  notice: