govuk_publishing_components 24.11.0 → 24.13.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +1 -1
  3. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +3 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +50 -31
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +0 -35
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +0 -13
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +0 -6
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +0 -4
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +10 -3
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +11 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +1 -1
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +0 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_show-password.scss +1 -0
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +8 -2
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +6 -2
  16. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -0
  17. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -1
  18. data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -3
  19. data/app/views/govuk_publishing_components/components/_attachment_link.html.erb +1 -1
  20. data/app/views/govuk_publishing_components/components/_character_count.html.erb +1 -1
  21. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +10 -3
  22. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +2 -2
  23. data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +16 -6
  24. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +14 -14
  25. data/app/views/govuk_publishing_components/components/_image_card.html.erb +15 -2
  26. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +6 -9
  27. data/app/views/govuk_publishing_components/components/_metadata.html.erb +6 -6
  28. data/app/views/govuk_publishing_components/components/_modal_dialogue.html.erb +1 -1
  29. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +13 -13
  30. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +11 -7
  31. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
  32. data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +4 -4
  33. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
  34. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +9 -9
  35. data/app/views/govuk_publishing_components/components/_success_alert.html.erb +1 -1
  36. data/app/views/govuk_publishing_components/components/_tabs.html.erb +1 -1
  37. data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +9 -4
  38. data/app/views/govuk_publishing_components/components/docs/government_navigation.yml +2 -0
  39. data/app/views/govuk_publishing_components/components/docs/inset_text.yml +2 -2
  40. data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +18 -15
  41. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +6 -6
  42. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +5 -5
  43. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +6 -6
  44. data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +2 -2
  45. data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +1 -1
  46. data/config/locales/ar.yml +33 -0
  47. data/config/locales/az.yml +33 -0
  48. data/config/locales/be.yml +33 -0
  49. data/config/locales/bg.yml +33 -0
  50. data/config/locales/bn.yml +33 -0
  51. data/config/locales/cs.yml +33 -0
  52. data/config/locales/cy.yml +34 -1
  53. data/config/locales/da.yml +33 -0
  54. data/config/locales/de.yml +33 -0
  55. data/config/locales/dr.yml +33 -0
  56. data/config/locales/el.yml +33 -0
  57. data/config/locales/en.yml +45 -9
  58. data/config/locales/es-419.yml +33 -0
  59. data/config/locales/es.yml +33 -0
  60. data/config/locales/et.yml +33 -0
  61. data/config/locales/fa.yml +33 -0
  62. data/config/locales/fi.yml +33 -0
  63. data/config/locales/fr.yml +33 -0
  64. data/config/locales/gd.yml +33 -0
  65. data/config/locales/gu.yml +33 -0
  66. data/config/locales/he.yml +33 -0
  67. data/config/locales/hi.yml +33 -0
  68. data/config/locales/hr.yml +33 -0
  69. data/config/locales/hu.yml +33 -0
  70. data/config/locales/hy.yml +33 -0
  71. data/config/locales/id.yml +33 -0
  72. data/config/locales/is.yml +33 -0
  73. data/config/locales/it.yml +33 -0
  74. data/config/locales/ja.yml +33 -0
  75. data/config/locales/ka.yml +33 -0
  76. data/config/locales/kk.yml +33 -0
  77. data/config/locales/ko.yml +33 -0
  78. data/config/locales/lt.yml +33 -0
  79. data/config/locales/lv.yml +33 -0
  80. data/config/locales/ms.yml +33 -0
  81. data/config/locales/mt.yml +33 -0
  82. data/config/locales/nl.yml +33 -0
  83. data/config/locales/no.yml +33 -0
  84. data/config/locales/pa-pk.yml +33 -0
  85. data/config/locales/pa.yml +33 -0
  86. data/config/locales/pl.yml +33 -0
  87. data/config/locales/ps.yml +33 -0
  88. data/config/locales/pt.yml +33 -0
  89. data/config/locales/ro.yml +33 -0
  90. data/config/locales/ru.yml +33 -0
  91. data/config/locales/si.yml +33 -0
  92. data/config/locales/sk.yml +33 -0
  93. data/config/locales/sl.yml +33 -0
  94. data/config/locales/so.yml +33 -0
  95. data/config/locales/sq.yml +33 -0
  96. data/config/locales/sr.yml +33 -0
  97. data/config/locales/sv.yml +33 -0
  98. data/config/locales/sw.yml +33 -0
  99. data/config/locales/ta.yml +33 -0
  100. data/config/locales/th.yml +33 -0
  101. data/config/locales/tk.yml +33 -0
  102. data/config/locales/tr.yml +33 -0
  103. data/config/locales/uk.yml +33 -0
  104. data/config/locales/ur.yml +33 -0
  105. data/config/locales/uz.yml +33 -0
  106. data/config/locales/vi.yml +33 -0
  107. data/config/locales/zh-hk.yml +33 -0
  108. data/config/locales/zh-tw.yml +33 -0
  109. data/config/locales/zh.yml +33 -0
  110. data/lib/govuk_publishing_components.rb +1 -0
  111. data/lib/govuk_publishing_components/presenters/brexit_cta_helper.rb +33 -0
  112. data/lib/govuk_publishing_components/presenters/content_item.rb +1 -3
  113. data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +0 -3
  114. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +1 -1
  115. data/lib/govuk_publishing_components/version.rb +1 -1
  116. metadata +8 -7
@@ -75,6 +75,7 @@
75
75
  // Links
76
76
 
77
77
  a {
78
+ @include govuk-link-common;
78
79
  @include govuk-link-style-default;
79
80
 
80
81
  &:focus {
@@ -32,6 +32,7 @@
32
32
 
33
33
  link_classes = %w(govuk-link gem-c-action-link__link)
34
34
  link_classes << shared_helper.classes if classes
35
+ link_classes << "govuk-link--inverse" if light_text
35
36
  %>
36
37
  <% if text.present? %>
37
38
  <div class="<%= css_classes.join(' ') %>">
@@ -55,7 +56,7 @@
55
56
  <span class="gem-c-action-link__subtext-wrapper">
56
57
  <% if subtext_href %>
57
58
  <%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") do %>
58
- <%= link_to subtext, subtext_href, class: "gem-c-action-link__subtext-link govuk-link", data: data %>
59
+ <%= link_to subtext, subtext_href, class: link_classes, data: data %>
59
60
  <% end %>
60
61
  <% else %>
61
62
  <%= content_tag(:span, subtext, class: "gem-c-action-link__subtext") %>
@@ -27,7 +27,7 @@
27
27
 
28
28
  if attachment.number_of_pages
29
29
  attributes << tag.span(
30
- pluralize(attachment.number_of_pages, "page"),
30
+ t("components.attachment.page", count: attachment.number_of_pages),
31
31
  class: "gem-c-attachment__attribute",
32
32
  )
33
33
  end
@@ -59,7 +59,7 @@
59
59
  <% end %>
60
60
 
61
61
  <% if attachment.reference.present? %>
62
- <%= tag.p "Ref: #{attachment.reference}", class: "gem-c-attachment__metadata gem-c-attachment__metadata--compact" %>
62
+ <%= tag.p t("components.attachment.reference", reference: attachment.reference), class: "gem-c-attachment__metadata gem-c-attachment__metadata--compact" %>
63
63
  <% end %>
64
64
 
65
65
  <% if attachment.unnumbered_reference.present? %>
@@ -71,7 +71,7 @@
71
71
  <% end %>
72
72
 
73
73
  <% if attachment.is_official_document && !hide_order_copy_link %>
74
- <%= tag.p link_to("Order a copy", "https://www.gov.uk/guidance/how-to-buy-printed-copies-of-official-documents", class: "govuk-link govuk-link--no-visited-state", target: "_blank"),
74
+ <%= tag.p link_to(t("components.attachment.order_a_copy"), "https://www.gov.uk/guidance/how-to-buy-printed-copies-of-official-documents", class: "govuk-link govuk-link--no-visited-state", target: "_blank"),
75
75
  class: "gem-c-attachment__metadata" %>
76
76
  <% end %>
77
77
 
@@ -24,7 +24,7 @@
24
24
 
25
25
  if attachment.number_of_pages
26
26
  attributes << tag.span(
27
- pluralize(attachment.number_of_pages, "page"),
27
+ I18n.t("components.attachment.page", count: attachment.number_of_pages),
28
28
  class: "gem-c-attachment-link__attribute",
29
29
  )
30
30
  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,13 +18,13 @@
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
  } %>
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>
@@ -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>
@@ -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>
@@ -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,7 +59,7 @@
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>
62
+ <h2 class="govuk-visually-hidden"><%= t("components.layout_footer.support_links") %></h2>
61
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">
@@ -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>
@@ -18,27 +18,27 @@
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) %>
@@ -46,7 +46,7 @@
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 %>
@@ -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>