govuk_publishing_components 24.12.0 → 24.13.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (113) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/analytics.js +3 -1
  3. data/app/assets/javascripts/govuk_publishing_components/analytics/custom-dimensions.js +2 -0
  4. data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +1 -1
  5. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +5 -3
  6. data/app/assets/javascripts/govuk_publishing_components/components/contextual-guidance.js +1 -1
  7. data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +9 -9
  8. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +3 -3
  9. data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +6 -0
  10. data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +5 -3
  11. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +3 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +50 -31
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +0 -35
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +0 -13
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +0 -6
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +0 -4
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +10 -3
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +11 -1
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +1 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +0 -1
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_show-password.scss +1 -0
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +8 -2
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +6 -2
  24. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -0
  25. data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -1
  26. data/app/views/govuk_publishing_components/components/_contents_list.html.erb +10 -3
  27. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +1 -1
  28. data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +49 -7
  29. data/app/views/govuk_publishing_components/components/_image_card.html.erb +15 -2
  30. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -0
  31. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +11 -2
  32. data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +13 -13
  33. data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +10 -6
  34. data/app/views/govuk_publishing_components/components/_search.html.erb +5 -2
  35. data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
  36. data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +7 -7
  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/layout_header/_header_logo.html.erb +3 -3
  42. data/config/locales/ar.yml +3 -0
  43. data/config/locales/az.yml +3 -0
  44. data/config/locales/be.yml +3 -0
  45. data/config/locales/bg.yml +3 -0
  46. data/config/locales/bn.yml +3 -0
  47. data/config/locales/cs.yml +3 -0
  48. data/config/locales/cy.yml +4 -1
  49. data/config/locales/da.yml +3 -0
  50. data/config/locales/de.yml +3 -0
  51. data/config/locales/dr.yml +3 -0
  52. data/config/locales/el.yml +3 -0
  53. data/config/locales/en.yml +4 -1
  54. data/config/locales/es-419.yml +3 -0
  55. data/config/locales/es.yml +3 -0
  56. data/config/locales/et.yml +3 -0
  57. data/config/locales/fa.yml +3 -0
  58. data/config/locales/fi.yml +3 -0
  59. data/config/locales/fr.yml +3 -0
  60. data/config/locales/gd.yml +3 -0
  61. data/config/locales/gu.yml +3 -0
  62. data/config/locales/he.yml +3 -0
  63. data/config/locales/hi.yml +3 -0
  64. data/config/locales/hr.yml +3 -0
  65. data/config/locales/hu.yml +3 -0
  66. data/config/locales/hy.yml +3 -0
  67. data/config/locales/id.yml +3 -0
  68. data/config/locales/is.yml +3 -0
  69. data/config/locales/it.yml +3 -0
  70. data/config/locales/ja.yml +3 -0
  71. data/config/locales/ka.yml +3 -0
  72. data/config/locales/kk.yml +3 -0
  73. data/config/locales/ko.yml +3 -0
  74. data/config/locales/lt.yml +3 -0
  75. data/config/locales/lv.yml +3 -0
  76. data/config/locales/ms.yml +3 -0
  77. data/config/locales/mt.yml +3 -0
  78. data/config/locales/nl.yml +3 -0
  79. data/config/locales/no.yml +3 -0
  80. data/config/locales/pa-pk.yml +3 -0
  81. data/config/locales/pa.yml +3 -0
  82. data/config/locales/pl.yml +3 -0
  83. data/config/locales/ps.yml +3 -0
  84. data/config/locales/pt.yml +3 -0
  85. data/config/locales/ro.yml +3 -0
  86. data/config/locales/ru.yml +3 -0
  87. data/config/locales/si.yml +3 -0
  88. data/config/locales/sk.yml +3 -0
  89. data/config/locales/sl.yml +3 -0
  90. data/config/locales/so.yml +3 -0
  91. data/config/locales/sq.yml +3 -0
  92. data/config/locales/sr.yml +3 -0
  93. data/config/locales/sv.yml +3 -0
  94. data/config/locales/sw.yml +3 -0
  95. data/config/locales/ta.yml +3 -0
  96. data/config/locales/th.yml +3 -0
  97. data/config/locales/tk.yml +3 -0
  98. data/config/locales/tr.yml +3 -0
  99. data/config/locales/uk.yml +3 -0
  100. data/config/locales/ur.yml +3 -0
  101. data/config/locales/uz.yml +3 -0
  102. data/config/locales/vi.yml +3 -0
  103. data/config/locales/zh-hk.yml +3 -0
  104. data/config/locales/zh-tw.yml +3 -0
  105. data/config/locales/zh.yml +3 -0
  106. data/lib/govuk_publishing_components.rb +1 -0
  107. data/lib/govuk_publishing_components/presenters/brexit_cta_helper.rb +33 -0
  108. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +15 -1
  109. data/lib/govuk_publishing_components/presenters/content_item.rb +1 -3
  110. data/lib/govuk_publishing_components/presenters/contents_list_helper.rb +0 -3
  111. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +1 -1
  112. data/lib/govuk_publishing_components/version.rb +1 -1
  113. metadata +8 -7
@@ -31,6 +31,16 @@
31
31
  &:hover,
32
32
  &:active {
33
33
  background-color: govuk-colour("light-grey", $legacy: "grey-4");
34
+
35
+ // Add govuk-link hover decoration to title if no label present
36
+ .gem-c-pagination__link-text--decorated {
37
+ @include govuk-link-decoration;
38
+ }
39
+
40
+ .gem-c-pagination__link-label,
41
+ .gem-c-pagination__link-text--decorated {
42
+ @include govuk-link-hover-decoration;
43
+ }
34
44
  }
35
45
 
36
46
  &:focus {
@@ -73,8 +83,8 @@
73
83
  .gem-c-pagination__link-label {
74
84
  display: inline-block;
75
85
  margin-top: .1em;
76
- text-decoration: underline;
77
86
  margin-left: govuk-spacing(5);
87
+ @include govuk-link-decoration;
78
88
 
79
89
  @include govuk-media-query($from: tablet) {
80
90
  margin-left: govuk-spacing(6);
@@ -20,6 +20,7 @@ $gem-c-print-link-background-height: 18px;
20
20
  background: image-url("govuk_publishing_components/icon-print.png") no-repeat govuk-spacing(2) 50%;
21
21
  background-size: $gem-c-print-link-background-width $gem-c-print-link-background-height;
22
22
  padding: govuk-spacing(2) govuk-spacing(2) govuk-spacing(2) (govuk-spacing(4) + $gem-c-print-link-background-width);
23
+ text-decoration: none;
23
24
 
24
25
  @include govuk-device-pixel-ratio($ratio: 2) {
25
26
  background-image: image-url("govuk_publishing_components/icon-print-2x.png");
@@ -32,7 +33,6 @@ $gem-c-print-link-background-height: 18px;
32
33
 
33
34
  .gem-c-print-link__link {
34
35
  box-shadow: inset 0 0 0 1px $govuk-border-colour;
35
- text-decoration: none;
36
36
 
37
37
  &:focus {
38
38
  border: 0;
@@ -22,7 +22,6 @@ $share-button-height: 32px;
22
22
  .gem-c-share-links__link {
23
23
  @include govuk-font(16, $weight: bold);
24
24
  margin-right: govuk-spacing(6);
25
- text-decoration: none;
26
25
 
27
26
  @include govuk-template-link-focus-override;
28
27
  }
@@ -49,6 +49,7 @@
49
49
 
50
50
  &:hover {
51
51
  color: $govuk-link-hover-colour;
52
+ @include govuk-link-hover-decoration;
52
53
  }
53
54
 
54
55
  &:focus {
@@ -116,7 +116,8 @@ $top-border: solid 1px govuk-colour("mid-grey", $legacy: "grey-3");
116
116
  padding: 0 0 govuk-spacing(1);
117
117
 
118
118
  &:hover .gem-c-step-nav__button-text {
119
- text-decoration: underline;
119
+ @include govuk-link-decoration;
120
+ @include govuk-link-hover-decoration;
120
121
  }
121
122
 
122
123
  .gem-c-step-nav--large & {
@@ -125,6 +126,10 @@ $top-border: solid 1px govuk-colour("mid-grey", $legacy: "grey-3");
125
126
 
126
127
  &:focus {
127
128
  @include step-nav-chevron-focus-state;
129
+
130
+ .gem-c-step-nav__button-text {
131
+ text-decoration: none;
132
+ }
128
133
  }
129
134
  }
130
135
 
@@ -338,7 +343,8 @@ $top-border: solid 1px govuk-colour("mid-grey", $legacy: "grey-3");
338
343
  }
339
344
 
340
345
  .gem-c-step-nav__button-text {
341
- text-decoration: underline;
346
+ @include govuk-link-decoration;
347
+ @include govuk-link-hover-decoration;
342
348
  }
343
349
  }
344
350
  }
@@ -45,7 +45,6 @@
45
45
 
46
46
  .gem-c-subscription-links__item {
47
47
  display: inline-block;
48
- text-decoration: none;
49
48
  background-repeat: no-repeat;
50
49
  background-position: 0 20%;
51
50
 
@@ -55,6 +54,7 @@
55
54
  }
56
55
 
57
56
  .gem-c-subscription-links__item--button {
57
+ cursor: pointer;
58
58
  display: none;
59
59
  font-size: inherit;
60
60
  font-weight: inherit;
@@ -71,6 +71,10 @@
71
71
  color: $govuk-link-colour;
72
72
  }
73
73
 
74
+ &:hover {
75
+ color: $govuk-link-hover-colour;
76
+ }
77
+
74
78
  &:visited,
75
79
  &:active,
76
80
  &:focus {
@@ -106,7 +110,7 @@
106
110
  }
107
111
 
108
112
  .gem-c-subscription-links__icon {
109
- margin-right: .1em;
113
+ margin-right: govuk-spacing(1);
110
114
  color: govuk-colour("black");
111
115
  }
112
116
 
@@ -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") %>
@@ -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}",
@@ -25,6 +25,6 @@
25
25
  <% end %>
26
26
 
27
27
  <% if navigation.show_brexit_cta? || navigation.show_brexit_related_links? %>
28
- <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta' %>
28
+ <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta', content_item: content_item %>
29
29
  <% end %>
30
30
  </div>
@@ -5,37 +5,79 @@
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">
8
+ <a class="<%= 'active' if active == 'departments' %> govuk-link govuk-link--no-underline govuk-link--inverse"
9
+ data-track-category="headerClicked"
10
+ data-track-action="departmentsLink"
11
+ data-track-label="/government/organisations"
12
+ data-track-dimension="<%= t("components.government_navigation.departments") %>"
13
+ data-track-dimension-index="29"
14
+ href="/government/organisations">
9
15
  <%= t("components.government_navigation.departments") %>
10
16
  </a>
11
17
  </li>
12
18
  <li>
13
- <a class="<%= 'active' if active == 'worldwide' %>" href="/government/world">
19
+ <a class="<%= 'active' if active == 'worldwide' %> govuk-link govuk-link--no-underline govuk-link--inverse"
20
+ data-track-category="headerClicked"
21
+ data-track-action="worldwideLink"
22
+ data-track-label="/world"
23
+ data-track-dimension="<%= t("components.government_navigation.worldwide") %>"
24
+ data-track-dimension-index="29"
25
+ href="/world">
14
26
  <%= t("components.government_navigation.worldwide") %>
15
27
  </a>
16
28
  </li>
17
29
  <li>
18
- <a class="<%= 'active' if active == 'how-government-works' %>" href="/government/how-government-works">
30
+ <a class="<%= 'active' if active == 'how-government-works' %> govuk-link govuk-link--no-underline govuk-link--inverse"
31
+ data-track-category="headerClicked"
32
+ data-track-action="governmentactivityLink"
33
+ data-track-label="/government/how-government-works"
34
+ data-track-dimension="<%= t("components.government_navigation.how-government-works") %>"
35
+ data-track-dimension-index="29"
36
+ href="/government/how-government-works">
19
37
  <%= t("components.government_navigation.how-government-works") %>
20
38
  </a>
21
39
  </li>
22
40
  <li>
23
- <a class="<%= 'active' if active == 'get-involved' %>" href="/government/get-involved">
41
+ <a class="<%= 'active' if active == 'get-involved' %> govuk-link govuk-link--no-underline govuk-link--inverse"
42
+ data-track-category="headerClicked"
43
+ data-track-action="governmentactivityLink"
44
+ data-track-label="/government/get-involved"
45
+ data-track-dimension="<%= t("components.government_navigation.get-involved") %>"
46
+ data-track-dimension-index="29"
47
+ href="/government/get-involved">
24
48
  <%= t("components.government_navigation.get-involved") %>
25
49
  </a>
26
50
  </li>
27
51
  <li class="clear-child">
28
- <a class="<%= 'active' if active == 'consultations' %>" href="<%= CGI::escapeHTML('/search/policy-papers-and-consultations?content_store_document_type[]=open_consultations&content_store_document_type[]=closed_consultations') %>">
52
+ <a class="<%= 'active' if active == 'consultations' %> govuk-link govuk-link--no-underline govuk-link--inverse"
53
+ data-track-category="headerClicked"
54
+ data-track-action="governmentactivityLink"
55
+ data-track-label="/government/get-involved"
56
+ data-track-dimension="<%= t("components.government_navigation.consultations") %>"
57
+ data-track-dimension-index="29"
58
+ href="<%= CGI::escapeHTML('/search/policy-papers-and-consultations?content_store_document_type[]=open_consultations&content_store_document_type[]=closed_consultations') %>">
29
59
  <%= t("components.government_navigation.consultations") %>
30
60
  </a>
31
61
  </li>
32
62
  <li>
33
- <a class="<%= 'active' if active == 'statistics' %>" href="/search/research-and-statistics">
63
+ <a class="<%= 'active' if active == 'statistics' %> govuk-link govuk-link--no-underline govuk-link--inverse"
64
+ data-track-category="headerClicked"
65
+ data-track-action="governmentactivityLink"
66
+ data-track-label="/government/research-and-statistics"
67
+ data-track-dimension="<%= t("components.government_navigation.statistics") %>"
68
+ data-track-dimension-index="29"
69
+ href="/search/research-and-statistics">
34
70
  <%= t("components.government_navigation.statistics") %>
35
71
  </a>
36
72
  </li>
37
73
  <li>
38
- <a class="<%= 'active' if active == 'announcements' %>" href="/news-and-communications">
74
+ <a class="<%= 'active' if active == 'announcements' %> govuk-link govuk-link--no-underline govuk-link--inverse"
75
+ data-track-category="headerClicked"
76
+ data-track-action="governmentactivityLink"
77
+ data-track-label="/search/news-and-communications"
78
+ data-track-dimension="<%= t("components.government_navigation.news_and_communications") %>"
79
+ data-track-dimension-index="29"
80
+ href="/search/news-and-communications">
39
81
  <%= t("components.government_navigation.news_and_communications") %>
40
82
  </a>
41
83
  </li>
@@ -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>
@@ -4,6 +4,7 @@
4
4
  global_bar ||= nil
5
5
  html_lang ||= "en"
6
6
  layout_helper = GovukPublishingComponents::Presenters::PublicLayoutHelper.new(local_assigns)
7
+ logo_link ||= "/"
7
8
  navigation_items ||= []
8
9
  omit_header ||= false
9
10
  show_search = local_assigns.include?(:show_search) ? local_assigns[:show_search] : true
@@ -71,6 +72,7 @@
71
72
  <% unless omit_header %>
72
73
  <%= render "govuk_publishing_components/components/layout_header", {
73
74
  search: show_search,
75
+ logo_link: logo_link,
74
76
  navigation_items: navigation_items,
75
77
 
76
78
  # The (blue) bottom border needs to be underneath the emergency banner -
@@ -8,6 +8,7 @@
8
8
  search ||= false
9
9
  search_left ||= false
10
10
  width_class = full_width ? "govuk-header__container--full-width" : "govuk-width-container"
11
+ logo_link ||= "/"
11
12
 
12
13
  header_classes = %w[gem-c-layout-header govuk-header]
13
14
  header_classes << "gem-c-layout-header--#{environment}" if environment
@@ -20,7 +21,11 @@
20
21
  <% if search_left %>
21
22
  <div class="govuk-grid-row">
22
23
  <div class="gem-c-layout-header__logo govuk-grid-column-one-third-from-desktop">
23
- <%= render "govuk_publishing_components/components/layout_header/header_logo", environment: environment, product_name: product_name %>
24
+ <%= render "govuk_publishing_components/components/layout_header/header_logo", {
25
+ environment: environment,
26
+ logo_link: logo_link,
27
+ product_name: product_name,
28
+ } %>
24
29
  </div>
25
30
  </div>
26
31
  <div class="govuk-grid-row">
@@ -36,7 +41,11 @@
36
41
  <% else %>
37
42
  <div class="govuk-grid-row">
38
43
  <div class="gem-c-layout-header__logo govuk-grid-column-two-thirds">
39
- <%= render "govuk_publishing_components/components/layout_header/header_logo", environment: environment, product_name: product_name %>
44
+ <%= render "govuk_publishing_components/components/layout_header/header_logo", {
45
+ environment: environment,
46
+ logo_link: logo_link,
47
+ product_name: product_name,
48
+ } %>
40
49
  </div>
41
50
  <% if navigation_items.any? %>
42
51
  <div class="govuk-header__content gem-c-header__content govuk-grid-column-full">
@@ -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 %>
@@ -6,6 +6,10 @@
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>