govuk_publishing_components 24.10.2 → 24.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (171) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -1
  3. data/app/assets/javascripts/govuk_publishing_components/components/feedback.js +142 -104
  4. data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +1 -1
  5. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +2 -2
  6. data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +1 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +3 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +0 -11
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +50 -31
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +0 -35
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +0 -13
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +0 -6
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +0 -4
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +10 -3
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +11 -1
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +1 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +0 -1
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_show-password.scss +1 -0
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +8 -2
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +6 -2
  21. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -0
  22. data/app/assets/stylesheets/govuk_publishing_components/components/print/_attachment.scss +2 -3
  23. data/app/assets/stylesheets/govuk_publishing_components/components/print/_back-link.scss +2 -3
  24. data/app/assets/stylesheets/govuk_publishing_components/components/print/_button.scss +0 -4
  25. data/app/assets/stylesheets/govuk_publishing_components/components/print/_feedback.scss +2 -3
  26. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-footer.scss +2 -6
  27. data/app/assets/stylesheets/govuk_publishing_components/components/print/_layout-header.scss +2 -3
  28. data/app/assets/stylesheets/govuk_publishing_components/components/print/_metadata.scss +2 -6
  29. data/app/assets/stylesheets/govuk_publishing_components/components/print/_search.scss +2 -3
  30. data/app/assets/stylesheets/govuk_publishing_components/components/print/_share-links.scss +2 -3
  31. data/app/assets/stylesheets/govuk_publishing_components/components/print/_skip-link.scss +2 -3
  32. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss +0 -4
  33. data/app/assets/stylesheets/govuk_publishing_components/components/print/_subscription-links.scss +2 -3
  34. data/app/assets/stylesheets/govuk_publishing_components/components/print/_translation-nav.scss +2 -3
  35. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -1
  36. data/app/views/govuk_publishing_components/components/_attachment.html.erb +4 -4
  37. data/app/views/govuk_publishing_components/components/_attachment_link.html.erb +1 -1
  38. data/app/views/govuk_publishing_components/components/_back_link.html.erb +1 -1
  39. data/app/views/govuk_publishing_components/components/_button.html.erb +1 -1
  40. data/app/views/govuk_publishing_components/components/_character_count.html.erb +1 -1
  41. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +10 -3
  42. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +1 -1
  43. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +16 -6
  44. data/app/views/govuk_publishing_components/components/_feedback.html.erb +1 -1
  45. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +14 -14
  46. data/app/views/govuk_publishing_components/components/_image_card.html.erb +15 -2
  47. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +8 -11
  48. data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -1
  49. data/app/views/govuk_publishing_components/components/_metadata.html.erb +7 -7
  50. data/app/views/govuk_publishing_components/components/_modal_dialogue.html.erb +1 -1
  51. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +13 -13
  52. data/app/views/govuk_publishing_components/components/_phase_banner.html.erb +1 -5
  53. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +11 -7
  54. data/app/views/govuk_publishing_components/components/_print_link.html.erb +1 -1
  55. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -1
  56. data/app/views/govuk_publishing_components/components/_share_links.html.erb +2 -2
  57. data/app/views/govuk_publishing_components/components/_skip_link.html.erb +1 -1
  58. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +6 -6
  59. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
  60. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +10 -10
  61. data/app/views/govuk_publishing_components/components/_success_alert.html.erb +1 -1
  62. data/app/views/govuk_publishing_components/components/_tabs.html.erb +1 -1
  63. data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
  64. data/app/views/govuk_publishing_components/components/docs/feedback.yml +2 -0
  65. data/app/views/govuk_publishing_components/components/docs/government_navigation.yml +2 -0
  66. data/app/views/govuk_publishing_components/components/docs/inset_text.yml +2 -2
  67. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +18 -15
  68. data/app/views/govuk_publishing_components/components/docs/phase_banner.yml +2 -2
  69. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +6 -6
  70. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +5 -5
  71. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +6 -6
  72. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +1 -1
  73. data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +4 -4
  74. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +1 -1
  75. data/config/locales/ar.yml +153 -0
  76. data/config/locales/az.yml +153 -0
  77. data/config/locales/be.yml +153 -0
  78. data/config/locales/bg.yml +153 -0
  79. data/config/locales/bn.yml +153 -0
  80. data/config/locales/cs.yml +153 -0
  81. data/config/locales/cy.yml +145 -6
  82. data/config/locales/da.yml +153 -0
  83. data/config/locales/de.yml +153 -0
  84. data/config/locales/dr.yml +153 -0
  85. data/config/locales/el.yml +153 -0
  86. data/config/locales/en.yml +142 -109
  87. data/config/locales/es-419.yml +153 -0
  88. data/config/locales/es.yml +153 -0
  89. data/config/locales/et.yml +150 -0
  90. data/config/locales/fa.yml +153 -0
  91. data/config/locales/fi.yml +153 -0
  92. data/config/locales/fr.yml +150 -0
  93. data/config/locales/gd.yml +153 -0
  94. data/config/locales/gu.yml +153 -0
  95. data/config/locales/he.yml +153 -0
  96. data/config/locales/hi.yml +153 -0
  97. data/config/locales/hr.yml +153 -0
  98. data/config/locales/hu.yml +153 -0
  99. data/config/locales/hy.yml +153 -0
  100. data/config/locales/id.yml +153 -0
  101. data/config/locales/is.yml +153 -0
  102. data/config/locales/it.yml +153 -0
  103. data/config/locales/ja.yml +153 -0
  104. data/config/locales/ka.yml +153 -0
  105. data/config/locales/kk.yml +153 -0
  106. data/config/locales/ko.yml +153 -0
  107. data/config/locales/lt.yml +153 -0
  108. data/config/locales/lv.yml +153 -0
  109. data/config/locales/ms.yml +153 -0
  110. data/config/locales/mt.yml +153 -0
  111. data/config/locales/nl.yml +153 -0
  112. data/config/locales/no.yml +154 -1
  113. data/config/locales/pa-pk.yml +153 -0
  114. data/config/locales/pa.yml +153 -0
  115. data/config/locales/pl.yml +153 -0
  116. data/config/locales/ps.yml +153 -0
  117. data/config/locales/pt.yml +153 -0
  118. data/config/locales/ro.yml +153 -0
  119. data/config/locales/ru.yml +153 -0
  120. data/config/locales/si.yml +153 -0
  121. data/config/locales/sk.yml +153 -0
  122. data/config/locales/sl.yml +153 -0
  123. data/config/locales/so.yml +153 -0
  124. data/config/locales/sq.yml +153 -0
  125. data/config/locales/sr.yml +153 -0
  126. data/config/locales/sv.yml +153 -0
  127. data/config/locales/sw.yml +153 -0
  128. data/config/locales/ta.yml +153 -0
  129. data/config/locales/th.yml +153 -0
  130. data/config/locales/tk.yml +153 -0
  131. data/config/locales/tr.yml +153 -0
  132. data/config/locales/uk.yml +153 -0
  133. data/config/locales/ur.yml +153 -0
  134. data/config/locales/uz.yml +153 -0
  135. data/config/locales/vi.yml +153 -0
  136. data/config/locales/zh-hk.yml +153 -0
  137. data/config/locales/zh-tw.yml +153 -0
  138. data/config/locales/zh.yml +153 -0
  139. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons.rb +1 -2
  140. data/lib/govuk_publishing_components/presenters/content_item.rb +5 -3
  141. data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +0 -3
  142. data/lib/govuk_publishing_components/presenters/machine_readable/page.rb +4 -0
  143. data/lib/govuk_publishing_components/version.rb +1 -1
  144. data/node_modules/govuk-frontend/govuk/components/accordion/_index.scss +7 -16
  145. data/node_modules/govuk-frontend/govuk/components/back-link/_index.scss +4 -15
  146. data/node_modules/govuk-frontend/govuk/components/character-count/macro-options.json +1 -1
  147. data/node_modules/govuk-frontend/govuk/components/checkboxes/macro-options.json +3 -3
  148. data/node_modules/govuk-frontend/govuk/components/cookie-banner/README.md +15 -0
  149. data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +40 -22
  150. data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +6 -6
  151. data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +15 -5
  152. data/node_modules/govuk-frontend/govuk/components/date-input/macro-options.json +2 -2
  153. data/node_modules/govuk-frontend/govuk/components/details/_index.scss +5 -1
  154. data/node_modules/govuk-frontend/govuk/components/file-upload/_index.scss +13 -14
  155. data/node_modules/govuk-frontend/govuk/components/file-upload/macro-options.json +1 -1
  156. data/node_modules/govuk-frontend/govuk/components/footer/_index.scss +14 -19
  157. data/node_modules/govuk-frontend/govuk/components/header/_index.scss +39 -21
  158. data/node_modules/govuk-frontend/govuk/components/input/macro-options.json +1 -1
  159. data/node_modules/govuk-frontend/govuk/components/phase-banner/_index.scss +1 -1
  160. data/node_modules/govuk-frontend/govuk/components/radios/macro-options.json +3 -3
  161. data/node_modules/govuk-frontend/govuk/components/select/macro-options.json +1 -1
  162. data/node_modules/govuk-frontend/govuk/components/skip-link/_index.scss +1 -1
  163. data/node_modules/govuk-frontend/govuk/components/tabs/_index.scss +1 -6
  164. data/node_modules/govuk-frontend/govuk/components/textarea/macro-options.json +1 -1
  165. data/node_modules/govuk-frontend/govuk/components/warning-text/_index.scss +10 -0
  166. data/node_modules/govuk-frontend/govuk/core/_links.scss +8 -0
  167. data/node_modules/govuk-frontend/govuk/helpers/_links.scss +153 -38
  168. data/node_modules/govuk-frontend/govuk/settings/_all.scss +2 -0
  169. data/node_modules/govuk-frontend/govuk/settings/_links.scss +62 -0
  170. data/node_modules/govuk-frontend/package.json +1 -1
  171. metadata +9 -7
@@ -5,6 +5,6 @@
5
5
  <%= link_to(
6
6
  text,
7
7
  href,
8
- class: %w(gem-c-back-link govuk-back-link),
8
+ class: %w(gem-c-back-link govuk-back-link govuk-!-display-none-print),
9
9
  data: data_attributes
10
10
  ) %>
@@ -7,7 +7,7 @@
7
7
 
8
8
  <% start_button_text = capture do %>
9
9
  <%= button.text %>
10
- <svg class="govuk-button__start-icon" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" role="presentation" focusable="false">
10
+ <svg class="govuk-button__start-icon govuk-!-display-none-print" xmlns="http://www.w3.org/2000/svg" width="17.5" height="19" viewBox="0 0 33 40" role="presentation" focusable="false">
11
11
  <path fill="currentColor" d="M0 0h13l20 20-20 20H0l20-20z" />
12
12
  </svg>
13
13
  <% end %>
@@ -18,7 +18,7 @@
18
18
  <%= render "govuk_publishing_components/components/textarea", { id: id, character_count: true }.merge(textarea.symbolize_keys) %>
19
19
 
20
20
  <span id="<%= id %>-info" class="govuk-hint govuk-character-count__message" aria-live="polite">
21
- You can enter up to <%= maxlength || maxwords %> <%= maxwords ? 'words' : 'characters' %>
21
+ <%= t("components.character_count", number: maxlength || maxwords, type: maxwords ? t("components.character_count.type.words") : t("components.character_count.type.characters")) %>
22
22
  </span>
23
23
  <% end %>
24
24
  <% end %>
@@ -1,12 +1,19 @@
1
1
  <%-
2
2
  cl_helper = GovukPublishingComponents::Presenters::ContentsListHelper.new(local_assigns)
3
+ underline_links ||= false
3
4
  aria_label ||= t("components.contents_list.contents")
4
5
  format_numbers ||= false
5
6
  brand ||= false
6
7
  brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
7
8
  title_fallback = t("components.contents_list.contents", locale: I18n.locale, fallback: false, default: "en")
8
- classes = cl_helper.classes
9
+ classes = %w[gem-c-contents-list]
9
10
  classes << brand_helper.brand_class
11
+ link_classes = %w[
12
+ gem-c-contents-list__link
13
+ govuk-link
14
+ ]
15
+ link_classes << brand_helper.color_class
16
+ link_classes << "govuk-link--no-underline" unless underline_links
10
17
  -%>
11
18
  <% if cl_helper.contents.any? %>
12
19
  <%= content_tag(
@@ -31,7 +38,7 @@
31
38
  <li class="<%= cl_helper.list_item_classes(contents_item, false) %>" <%= "aria-current=true" if contents_item[:active] %>>
32
39
  <% link_text = format_numbers ? cl_helper.wrap_numbers_with_spans(contents_item[:text]) : contents_item[:text] %>
33
40
  <%= link_to_if !contents_item[:active], link_text, contents_item[:href],
34
- class: "gem-c-contents-list__link govuk-link #{brand_helper.color_class}",
41
+ class: link_classes,
35
42
  data: {
36
43
  track_category: 'contentsClicked',
37
44
  track_action: "content_item #{position}",
@@ -47,7 +54,7 @@
47
54
  <% contents_item[:items].each.with_index(1) do |nested_contents_item, nested_position| %>
48
55
  <li class="<%= cl_helper.list_item_classes(nested_contents_item, true) %>" <%= "aria-current=true" if nested_contents_item[:active] %>>
49
56
  <%= link_to_if !nested_contents_item[:active], nested_contents_item[:text], nested_contents_item[:href],
50
- class: "gem-c-contents-list__link govuk-link #{brand_helper.color_class}",
57
+ class: link_classes,
51
58
  data: {
52
59
  track_category: 'contentsClicked',
53
60
  track_action: "nested_content_item #{position}:#{nested_position}",
@@ -18,7 +18,7 @@
18
18
  <% if navigation.content_tagged_to_other_step_by_steps? %>
19
19
  <%# Rendering step by step related items because there are a few but not too many of them %>
20
20
  <%= render 'govuk_publishing_components/components/step_by_step_nav_related', {
21
- pretitle: "Also part of",
21
+ pretitle: t("components.contextual_sidebar.pretitle"),
22
22
  links: navigation.step_nav_helper.also_part_of_step_nav,
23
23
  always_display_as_list: true
24
24
  } %>
@@ -1,7 +1,7 @@
1
1
  <%
2
2
  id ||= 'global-cookie-message'
3
- title ||= "Cookies on GOV.UK"
4
- text ||= ["We use some essential cookies to make this website work.", "We’d like to set additional cookies to understand how you use GOV.UK, remember your settings and improve government services.", "We also use cookies set by other sites to help us deliver content from their services."]
3
+ title ||= t("components.cookie_banner.title")
4
+ text ||= t("components.cookie_banner.text")
5
5
  if text.kind_of?(Array)
6
6
  newtext = ""
7
7
  text.each do |t|
@@ -14,7 +14,17 @@
14
14
  text = raw(text)
15
15
 
16
16
  cookie_preferences_href ||= "/help/cookies"
17
- confirmation_message ||= raw("You can <a class='govuk-link' href='#{cookie_preferences_href}' data-module='gem-track-click' data-track-category='cookieBanner' data-track-action='Cookie banner settings clicked from confirmation'>change your cookie settings</a> at any time.")
17
+ confirmation_message ||= raw(t("components.cookie_banner.confirmation_message",
18
+ link: link_to(
19
+ t("components.cookie_banner.confirmation_message_link"),
20
+ cookie_preferences_href,
21
+ class: "govuk-link",
22
+ data: {
23
+ module: "gem-track-click",
24
+ 'track-category': "cookieBanner",
25
+ 'track-action': "Cookie banner settings clicked from confirmation",
26
+ },
27
+ )))
18
28
  services_cookies ||= nil
19
29
  css_classes = %w(gem-c-cookie-banner govuk-clearfix)
20
30
  css_classes << "gem-c-cookie-banner--services" if services_cookies
@@ -50,7 +60,7 @@
50
60
  <div class="govuk-button-group">
51
61
  <%= render "govuk_publishing_components/components/button", {
52
62
  name: "cookies",
53
- text: "Accept additional cookies",
63
+ text: t("components.cookie_banner.buttons.accept_cookies"),
54
64
  data_attributes: {
55
65
  module: "gem-track-click",
56
66
  "accept-cookies": "true",
@@ -61,7 +71,7 @@
61
71
  } %>
62
72
  <%= render "govuk_publishing_components/components/button", {
63
73
  name: "cookies",
64
- text: "Reject additional cookies",
74
+ text: t("components.cookie_banner.buttons.reject_cookies"),
65
75
  data_attributes: {
66
76
  module: "gem-track-click",
67
77
  "reject-cookies": "true",
@@ -77,7 +87,7 @@
77
87
  <div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1" hidden>
78
88
  <p class="gem-c-cookie-banner__confirmation-message" role="alert"><%= confirmation_message %></p>
79
89
  <div class="govuk-button-group">
80
- <button class="gem-c-cookie-banner__hide-button govuk-button" data-hide-cookie-banner="true" data-module="gem-track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner">Hide this message</button>
90
+ <button class="gem-c-cookie-banner__hide-button govuk-button" data-hide-cookie-banner="true" data-module="gem-track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner"><%= t("components.cookie_banner.hide") %></button>
81
91
  </div>
82
92
  </div>
83
93
  </div>
@@ -8,7 +8,7 @@
8
8
  path_without_pii = utf_encode(request.fullpath.gsub(email_regex, '[email]'))
9
9
  %>
10
10
 
11
- <div class="gem-c-feedback" data-module="feedback">
11
+ <div class="gem-c-feedback govuk-!-display-none-print" data-module="feedback">
12
12
  <%= render "govuk_publishing_components/components/feedback/yes_no_banner" %>
13
13
  <%= render "govuk_publishing_components/components/feedback/problem_form", url_without_pii: url_without_pii %>
14
14
  <%= render "govuk_publishing_components/components/feedback/survey_signup_form", path_without_pii: path_without_pii %>
@@ -5,38 +5,38 @@
5
5
  <nav id="proposition-menu" class="no-proposition-name gem-c-government-navigation" aria-label="Departments and policy navigation">
6
6
  <ul id="proposition-links">
7
7
  <li>
8
- <a class="<%= 'active' if active == 'departments' %>" href="/government/organisations">
9
- <%= t("components.government_navigation.departments", default: "Departments") %>
8
+ <a class="<%= 'active' if active == 'departments' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/organisations">
9
+ <%= t("components.government_navigation.departments") %>
10
10
  </a>
11
11
  </li>
12
12
  <li>
13
- <a class="<%= 'active' if active == 'worldwide' %>" href="/government/world">
14
- <%= t("components.government_navigation.worldwide", default: "Worldwide") %>
13
+ <a class="<%= 'active' if active == 'worldwide' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/world">
14
+ <%= t("components.government_navigation.worldwide") %>
15
15
  </a>
16
16
  </li>
17
17
  <li>
18
- <a class="<%= 'active' if active == 'how-government-works' %>" href="/government/how-government-works">
19
- <%= t("components.government_navigation.how-government-works", default: "How government works") %>
18
+ <a class="<%= 'active' if active == 'how-government-works' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/how-government-works">
19
+ <%= t("components.government_navigation.how-government-works") %>
20
20
  </a>
21
21
  </li>
22
22
  <li>
23
- <a class="<%= 'active' if active == 'get-involved' %>" href="/government/get-involved">
24
- <%= t("components.government_navigation.get-involved", default: "Get involved") %>
23
+ <a class="<%= 'active' if active == 'get-involved' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/government/get-involved">
24
+ <%= t("components.government_navigation.get-involved") %>
25
25
  </a>
26
26
  </li>
27
27
  <li class="clear-child">
28
- <a class="<%= 'active' if active == 'consultations' %>" href="<%= CGI::escapeHTML('/search/policy-papers-and-consultations?content_store_document_type[]=open_consultations&content_store_document_type[]=closed_consultations') %>">
29
- <%= t("components.government_navigation.consultations", default: "Consultations") %>
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') %>">
29
+ <%= t("components.government_navigation.consultations") %>
30
30
  </a>
31
31
  </li>
32
32
  <li>
33
- <a class="<%= 'active' if active == 'statistics' %>" href="/search/research-and-statistics">
34
- <%= t("components.government_navigation.statistics", default: "Statistics") %>
33
+ <a class="<%= 'active' if active == 'statistics' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/search/research-and-statistics">
34
+ <%= t("components.government_navigation.statistics") %>
35
35
  </a>
36
36
  </li>
37
37
  <li>
38
- <a class="<%= 'active' if active == 'announcements' %>" href="/news-and-communications">
39
- <%= t("components.government_navigation.news_and_communications", default: "News and communications") %>
38
+ <a class="<%= 'active' if active == 'announcements' %> govuk-link govuk-link--no-underline govuk-link--inverse" href="/news-and-communications">
39
+ <%= t("components.government_navigation.news_and_communications") %>
40
40
  </a>
41
41
  </li>
42
42
  </ul>
@@ -10,6 +10,19 @@
10
10
  font_size ||= card_helper.large ? 'm' : 's'
11
11
  heading_class = %w[gem-c-image-card__title]
12
12
  heading_class << shared_helper.get_heading_size(font_size, 's')
13
+
14
+ heading_link_classes = %w[
15
+ gem-c-image-card__title-link
16
+ govuk-link
17
+ govuk-link--no-underline
18
+ ]
19
+ heading_link_classes << brand_helper.color_class
20
+ extra_link_classes = %w[
21
+ gem-c-image-card__list-item-link
22
+ govuk-link
23
+ ]
24
+ extra_link_classes << brand_helper.color_class
25
+
13
26
  %>
14
27
  <% if card_helper.href || card_helper.extra_links.any? %>
15
28
  <div class="<%= classes %> <%= brand_helper.brand_class %>"
@@ -21,7 +34,7 @@
21
34
  <%= content_tag(shared_helper.get_heading_level, class: heading_class) do %>
22
35
  <% if card_helper.href %>
23
36
  <%= link_to card_helper.heading_text, card_helper.href,
24
- class: "gem-c-image-card__title-link govuk-link #{brand_helper.color_class}",
37
+ class: heading_link_classes,
25
38
  data: card_helper.href_data_attributes
26
39
  %>
27
40
  <% else %>
@@ -37,7 +50,7 @@
37
50
  <% card_helper.extra_links.each do |link| %>
38
51
  <li class="gem-c-image-card__list-item">
39
52
  <%= link_to link[:text], link[:href],
40
- class: "gem-c-image-card__list-item-link govuk-link #{brand_helper.color_class}",
53
+ class: extra_link_classes,
41
54
  data: link[:data_attributes]
42
55
  %>
43
56
  </li>
@@ -29,7 +29,7 @@
29
29
  list_classes = %w[govuk-footer__list]
30
30
  list_classes << "govuk-footer__list--columns-#{item[:columns]}" if item[:columns] unless single_item_list
31
31
  %>
32
- <div class="<%= width_class %>">
32
+ <div class="<%= width_class %> govuk-!-display-none-print">
33
33
  <h2 class="govuk-footer__heading govuk-heading-m"><%= item[:title] %></h2>
34
34
  <ul class="<%= list_classes.join(' ') %>">
35
35
  <% item[:items].each do |item| %>
@@ -38,7 +38,9 @@
38
38
  <%
39
39
  attributes = {
40
40
  class: "govuk-footer__link",
41
- "data-track-category": "footerClicked"
41
+ data: {
42
+ "track-category": "footerClicked"
43
+ }
42
44
  }.merge(item.fetch(:attributes, {}))
43
45
  attributes[:rel] = "noopener" if attributes[:target] == "_blank" && !attributes[:rel]
44
46
  %>
@@ -57,8 +59,8 @@
57
59
  <div class="govuk-footer__meta">
58
60
  <div class="govuk-footer__meta-item govuk-footer__meta-item--grow">
59
61
  <% if meta.any? %>
60
- <h2 class="govuk-visually-hidden">Support links</h2>
61
- <ul class="govuk-footer__inline-list">
62
+ <h2 class="govuk-visually-hidden"><%= t("components.layout_footer.support_links") %></h2>
63
+ <ul class="govuk-footer__inline-list govuk-!-display-none-print">
62
64
  <% meta[:items].each do |item| %>
63
65
  <li class="govuk-footer__inline-list-item">
64
66
  <%
@@ -77,16 +79,11 @@
77
79
  />
78
80
  </svg>
79
81
  <span class="govuk-footer__licence-description">
80
- All content is available under the
81
- <a
82
- class="govuk-footer__link"
83
- href="https://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"
84
- rel="license"
85
- >Open Government Licence v3.0</a>, except where otherwise stated
82
+ <%= t("components.layout_footer.licence_html") %>
86
83
  </span>
87
84
  </div>
88
85
  <div class="govuk-footer__meta-item">
89
- <a class="govuk-footer__link govuk-footer__copyright-logo" href="http://www.nationalarchives.gov.uk/information-management/re-using-public-sector-information/copyright-and-re-use/crown-copyright/" Crown copyright</a>
86
+ <%= t("components.layout_footer.copyright_html") %>
90
87
  </div>
91
88
  </div>
92
89
  </div>
@@ -17,7 +17,7 @@
17
17
  <meta property="og:site_name" content="GOV.UK" />
18
18
  <meta property="og:type" content="article" />
19
19
  <meta property="og:url" content="<%= page.canonical_url %>" />
20
- <meta property="og:title" content="<%= page.title %>" />
20
+ <meta property="og:title" content="<% if page.withdrawn? %>[Withdrawn] <% end %><%= page.title %>" />
21
21
  <meta property="og:description" content="<%= strip_tags(page.description) %>" />
22
22
 
23
23
  <% if page.has_image? %>
@@ -18,35 +18,35 @@
18
18
  <%= content_tag :div, class: classes, data: { module: "gem-toggle" } do %>
19
19
  <dl data-module="gem-track-click">
20
20
  <% if from.any? %>
21
- <dt class="gem-c-metadata__term"><%= t("components.metadata.from", default: "From") %>:</dt>
21
+ <dt class="gem-c-metadata__term"><%= t("components.metadata.from") %>:</dt>
22
22
  <dd class="gem-c-metadata__definition">
23
23
  <%= render 'govuk_publishing_components/components/metadata/sentence', items: from, toggle_id: "from-#{SecureRandom.hex(4)}" %>
24
24
  </dd>
25
25
  <% end %>
26
26
  <% if part_of.any? %>
27
- <dt class="gem-c-metadata__term"><%= t("components.metadata.part_of", default: "Part of") %>:</dt>
27
+ <dt class="gem-c-metadata__term"><%= t("components.metadata.part_of") %>:</dt>
28
28
  <dd class="gem-c-metadata__definition">
29
29
  <%= render 'govuk_publishing_components/components/metadata/sentence', items: part_of, toggle_id: "part-of-#{SecureRandom.hex(4)}" %>
30
30
  </dd>
31
31
  <% end %>
32
32
  <% if local_assigns.include?(:history) %>
33
- <dt class="gem-c-metadata__term"><%= t("components.metadata.history", default: "History") %>:</dt>
33
+ <dt class="gem-c-metadata__term"><%= t("components.metadata.history") %>:</dt>
34
34
  <dd class="gem-c-metadata__definition"><%= history %></dd>
35
35
  <% end %>
36
36
  <% if local_assigns.include?(:first_published) && first_published %>
37
- <dt class="gem-c-metadata__term"><%= t("components.metadata.published", default: "Published") %></dt>
37
+ <dt class="gem-c-metadata__term"><%= t("components.metadata.published") %></dt>
38
38
  <dd class="gem-c-metadata__definition"><%= first_published %></dd>
39
39
  <% end %>
40
40
  <% if local_assigns.include?(:last_updated) && last_updated %>
41
- <dt class="gem-c-metadata__term"><%= t("components.metadata.last_updated", default: "Last updated") %></dt>
41
+ <dt class="gem-c-metadata__term"><%= t("components.metadata.last_updated") %></dt>
42
42
  <dd class="gem-c-metadata__definition">
43
43
  <%= last_updated %>
44
44
  <% if local_assigns.include?(:see_updates_link) %>
45
- &#8212; <a href="#history" class="gem-c-metadata__definition-link"
45
+ &#8212; <a href="#history" class="gem-c-metadata__definition-link govuk-!-display-none-print"
46
46
  data-track-category="content-history"
47
47
  data-track-action="see-all-updates-link-clicked"
48
48
  data-track-label="history">
49
- <%= t("components.metadata.see_all_updates", default: "see all updates") %>
49
+ <%= t("components.metadata.see_all_updates") %>
50
50
  </a>
51
51
  <% end %>
52
52
  </dd>
@@ -18,6 +18,6 @@
18
18
  </svg>
19
19
  <% end %>
20
20
  <%= tag.div yield, class: "gem-c-modal-dialogue__content" %>
21
- <%= tag.button "×", class: "gem-c-modal-dialogue__close-button", aria: { label: "Close modal dialogue" } %>
21
+ <%= tag.button "×", class: "gem-c-modal-dialogue__close-button", aria: { label: t("components.modal_dialogue.close_modal") } %>
22
22
  <% end %>
23
23
  <% end %>
@@ -6,16 +6,13 @@
6
6
  heading_level ||= false
7
7
  inline ||= false
8
8
 
9
- # Check if `heading_level` is a number; if so, check if it's an appropriate
10
- # number.
11
- use_heading = heading_level.is_a?(Integer) ?
12
- (heading_level >= 1 && heading_level <= 6) :
13
- false
9
+ # Check if `heading_level` is an appropriate number:
10
+ use_heading = [*1..6].include?(heading_level)
14
11
 
15
- # Set the wrapping element to be a heading or a `div`
16
- wrapping_element = use_heading ? "h#{heading_level}" : "div"
12
+ # Set the wrapping element to be a heading or a `div`:
13
+ wrapping_element = (use_heading ? "h#{heading_level}" : "div").to_sym
17
14
 
18
- wrapper_classes = %w(gem-c-organisation-logo)
15
+ wrapper_classes = %w[gem-c-organisation-logo]
19
16
  wrapper_classes << brand_helper.brand_class
20
17
 
21
18
  container_classes = [
@@ -24,10 +21,13 @@
24
21
  ]
25
22
  container_classes << "gem-c-organisation-logo__container--inline" if inline
26
23
  %>
27
- <<%= wrapping_element %>
28
- class="<%= wrapper_classes.join(" ") %>"
29
- <%= "data-module=gem-track-click" if organisation[:data_attributes] %>
30
- >
24
+
25
+ <%= content_tag(wrapping_element, {
26
+ class: wrapper_classes,
27
+ data: {
28
+ module: ("gem-track-click" if organisation[:data_attributes])
29
+ }
30
+ }) do %>
31
31
  <% if organisation[:url] %>
32
32
  <%= link_to organisation[:url],
33
33
  class: container_classes.join(" "),
@@ -39,4 +39,4 @@
39
39
  <%= logo_helper.logo_content %>
40
40
  </div>
41
41
  <% end %>
42
- </<%= wrapping_element %>>
42
+ <% end %>
@@ -4,10 +4,6 @@ phase ||= nil
4
4
  message ||= nil
5
5
  inverse ||= false
6
6
 
7
- unless phase.in?(%w[alpha beta])
8
- raise ArgumentError, "The phase banner component expects a `phase` (`beta` or `alpha`), #{phase.inspect} given"
9
- end
10
-
11
7
  unless message.present?
12
8
  if phase == "beta"
13
9
  message = raw("This part of GOV.UK is being rebuilt &ndash; <a class=\"govuk-link\" href=\"/help/beta\">find out what beta means</a>")
@@ -23,7 +19,7 @@ container_css_classes << "gem-c-phase-banner--inverse" if inverse
23
19
  <%= tag.div class: container_css_classes do %>
24
20
  <%= tag.p class: "govuk-phase-banner__content" do %>
25
21
  <%= tag.strong app_name, class: "govuk-phase-banner__content__app-name" if app_name %>
26
- <%= tag.strong phase, class: "govuk-tag govuk-phase-banner__content__tag" %>
22
+ <%= tag.strong phase, class: "govuk-tag govuk-phase-banner__content__tag" if phase %>
27
23
  <%= tag.span message, class: "govuk-phase-banner__text" if message %>
28
24
  <% end %>
29
25
  <% end %>
@@ -2,10 +2,14 @@
2
2
  <nav
3
3
  class="gem-c-pagination"
4
4
  role="navigation"
5
- aria-label="<%= t("components.previous_and_next_navigation.pagination", default: "Pagination") %>"
5
+ aria-label="<%= t("components.previous_and_next_navigation.pagination") %>"
6
6
  >
7
7
  <ul class="gem-c-pagination__list" data-module="gem-track-click">
8
8
  <% if local_assigns.include?(:previous_page) %>
9
+ <%
10
+ link_text_classes = %w[gem-c-pagination__link-text]
11
+ link_text_classes << "gem-c-pagination__link-text--decorated" unless previous_page[:label].present?
12
+ %>
9
13
  <li class="gem-c-pagination__item gem-c-pagination__item--previous">
10
14
  <a href="<%= previous_page[:url] %>"
11
15
  class="govuk-link gem-c-pagination__link"
@@ -20,9 +24,7 @@
20
24
  <svg class="gem-c-pagination__link-icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17" viewBox="0 0 17 13">
21
25
  <path d="m6.5938-0.0078125-6.7266 6.7266 6.7441 6.4062 1.377-1.449-4.1856-3.9768h12.896v-2h-12.984l4.2931-4.293-1.414-1.414z"/>
22
26
  </svg>
23
- <span class="gem-c-pagination__link-text">
24
- <%= previous_page[:title] %>
25
- </span>
27
+ <%= tag.span(previous_page[:title], class: link_text_classes) %>
26
28
  </span>
27
29
  <% if previous_page[:label].present? %>
28
30
  <span class="gem-c-pagination__link-divider visually-hidden">:</span>
@@ -32,6 +34,10 @@
32
34
  </li>
33
35
  <% end %>
34
36
  <% if local_assigns.include?(:next_page) %>
37
+ <%
38
+ link_text_classes = %w[gem-c-pagination__link-text]
39
+ link_text_classes << "gem-c-pagination__link-text--decorated" unless next_page[:label].present?
40
+ %>
35
41
  <li class="gem-c-pagination__item gem-c-pagination__item--next">
36
42
  <a href="<%= next_page[:url] %>"
37
43
  class="govuk-link gem-c-pagination__link"
@@ -46,9 +52,7 @@
46
52
  <svg class="gem-c-pagination__link-icon" xmlns="http://www.w3.org/2000/svg" height="13" width="17" viewBox="0 0 17 13">
47
53
  <path d="m10.107-0.0078125-1.4136 1.414 4.2926 4.293h-12.986v2h12.896l-4.1855 3.9766 1.377 1.4492 6.7441-6.4062-6.7246-6.7266z"/>
48
54
  </svg>
49
- <span class="gem-c-pagination__link-text">
50
- <%= next_page[:title] %>
51
- </span>
55
+ <%= tag.span(next_page[:title], class: link_text_classes) %>
52
56
  </span>
53
57
  <% if next_page[:label].present? %>
54
58
  <span class="gem-c-pagination__link-divider visually-hidden">:</span>