govuk_publishing_components 28.8.1 → 28.9.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/analytics/cross-domain-tracking.js +55 -0
  3. data/app/assets/javascripts/govuk_publishing_components/analytics.js +3 -0
  4. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  5. data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +1 -0
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +2 -1
  7. data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +102 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +1 -6
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +2 -1
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +1 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +1 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/print/_cards.scss +4 -0
  14. data/app/views/govuk_publishing_components/components/_cards.html.erb +46 -0
  15. data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +2 -2
  16. data/app/views/govuk_publishing_components/components/_input.html.erb +3 -0
  17. data/app/views/govuk_publishing_components/components/_lead_paragraph.html.erb +0 -1
  18. data/app/views/govuk_publishing_components/components/_summary_list.html.erb +27 -22
  19. data/app/views/govuk_publishing_components/components/contextual_sidebar/{_brexit_cta.html.erb → _ukraine_cta.html.erb} +6 -6
  20. data/app/views/govuk_publishing_components/components/docs/attachment.yml +1 -1
  21. data/app/views/govuk_publishing_components/components/docs/cards.yml +145 -0
  22. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +12 -21
  23. data/app/views/govuk_publishing_components/components/docs/input.yml +16 -13
  24. data/app/views/govuk_publishing_components/components/docs/list.yml +1 -1
  25. data/app/views/govuk_publishing_components/components/docs/summary_list.yml +2 -7
  26. data/config/locales/ar.yml +4 -0
  27. data/config/locales/az.yml +4 -0
  28. data/config/locales/be.yml +4 -0
  29. data/config/locales/bg.yml +4 -0
  30. data/config/locales/bn.yml +4 -0
  31. data/config/locales/cs.yml +4 -0
  32. data/config/locales/cy.yml +4 -0
  33. data/config/locales/da.yml +4 -0
  34. data/config/locales/de.yml +4 -0
  35. data/config/locales/dr.yml +4 -0
  36. data/config/locales/el.yml +4 -0
  37. data/config/locales/en.yml +6 -2
  38. data/config/locales/es-419.yml +4 -0
  39. data/config/locales/es.yml +4 -0
  40. data/config/locales/et.yml +4 -0
  41. data/config/locales/fa.yml +4 -0
  42. data/config/locales/fi.yml +4 -0
  43. data/config/locales/fr.yml +4 -0
  44. data/config/locales/gd.yml +4 -0
  45. data/config/locales/gu.yml +4 -0
  46. data/config/locales/he.yml +4 -0
  47. data/config/locales/hi.yml +4 -0
  48. data/config/locales/hr.yml +4 -0
  49. data/config/locales/hu.yml +4 -0
  50. data/config/locales/hy.yml +4 -0
  51. data/config/locales/id.yml +4 -0
  52. data/config/locales/is.yml +4 -0
  53. data/config/locales/it.yml +4 -0
  54. data/config/locales/ja.yml +4 -0
  55. data/config/locales/ka.yml +4 -0
  56. data/config/locales/kk.yml +4 -0
  57. data/config/locales/ko.yml +4 -0
  58. data/config/locales/lt.yml +4 -0
  59. data/config/locales/lv.yml +4 -0
  60. data/config/locales/ms.yml +4 -0
  61. data/config/locales/mt.yml +4 -0
  62. data/config/locales/nl.yml +4 -0
  63. data/config/locales/no.yml +4 -0
  64. data/config/locales/pa-pk.yml +4 -0
  65. data/config/locales/pa.yml +4 -0
  66. data/config/locales/pl.yml +4 -0
  67. data/config/locales/ps.yml +4 -0
  68. data/config/locales/pt.yml +4 -0
  69. data/config/locales/ro.yml +4 -0
  70. data/config/locales/ru.yml +4 -0
  71. data/config/locales/si.yml +4 -0
  72. data/config/locales/sk.yml +4 -0
  73. data/config/locales/sl.yml +4 -0
  74. data/config/locales/so.yml +4 -0
  75. data/config/locales/sq.yml +4 -0
  76. data/config/locales/sr.yml +4 -0
  77. data/config/locales/sv.yml +4 -0
  78. data/config/locales/sw.yml +4 -0
  79. data/config/locales/ta.yml +4 -0
  80. data/config/locales/th.yml +4 -0
  81. data/config/locales/tk.yml +4 -0
  82. data/config/locales/tr.yml +4 -0
  83. data/config/locales/uk.yml +4 -0
  84. data/config/locales/ur.yml +4 -0
  85. data/config/locales/uz.yml +4 -0
  86. data/config/locales/vi.yml +4 -0
  87. data/config/locales/zh-hk.yml +4 -0
  88. data/config/locales/zh-tw.yml +4 -0
  89. data/config/locales/zh.yml +4 -0
  90. data/lib/govuk_publishing_components/presenters/attachment.rb +3 -7
  91. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +16 -45
  92. data/lib/govuk_publishing_components/version.rb +1 -1
  93. metadata +11 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 56d5f41976b37b95a3d00db9c7375f7d500879dc0715134227b7f3e935b88ecf
4
- data.tar.gz: debdecb330a017f20cabbdc4a2635709f3101a1c9ab7c95043a4cf12283258e8
3
+ metadata.gz: c6a4c2646d8ee1669ae9211306d03382e424c905c6de355bb5f81b5251da6e10
4
+ data.tar.gz: 13453d8a1226005ff9535eb9dce3927f450ce1a6ec6acf6daf8170ad9ffeb2e0
5
5
  SHA512:
6
- metadata.gz: 1a27ffd2c2449ac670a5726512a140d379cd960371107afe40a4d563a3d15f054280a23dbd01acbd2734047628b91d1b2baee7d7405c680ba87122a1b4c5cc6f
7
- data.tar.gz: 1a8d05393b71c257a6dc2af490515a61ce5680aec77ba96b16bd0e4cd64b7ced87be26d9db70f1315426f9b71687c0ac06bf7897c3409968a11f9be40e89c847
6
+ metadata.gz: 8fcda8c161715befc29844b659249668e5d2ba375f3d398f994e1e3c2348a78635516704e655f95df96aa21a9438d1079cfdb9977944020a3cfe9e7c96611a05
7
+ data.tar.gz: 7d838cc5bd1295ba3faeab424a0a6d10a5af087601e90d859eaee2a0ecc0222ee41330672800739308d34f7bb662a341f470cb8f74915cc7eb6a328555360a0a
@@ -0,0 +1,55 @@
1
+ window.GOVUK = window.GOVUK || {}
2
+ window.GOVUK.Modules = window.GOVUK.Modules || {};
3
+
4
+ (function (Modules) {
5
+ function CrossDomainTracking ($module) {
6
+ this.$module = $module
7
+ Modules.crossDomainLinkedTrackers = Modules.crossDomainLinkedTrackers || []
8
+ }
9
+
10
+ CrossDomainTracking.prototype.init = function () {
11
+ if (this.isTrackable(this.$module)) {
12
+ this.addLinkedTrackerDomain(this.$module)
13
+ } else {
14
+ this.findTrackableElements()
15
+ }
16
+ }
17
+
18
+ CrossDomainTracking.prototype.isTrackable = function (element) {
19
+ if (element.getAttribute('href') && element.getAttribute('data-tracking-code') && element.getAttribute('data-tracking-name')) {
20
+ return true
21
+ }
22
+ }
23
+
24
+ CrossDomainTracking.prototype.findTrackableElements = function () {
25
+ var links = this.$module.querySelectorAll('a')
26
+ for (var i = 0; i < links.length; i++) {
27
+ if (this.isTrackable(links[i])) {
28
+ this.addLinkedTrackerDomain(links[i])
29
+ }
30
+ }
31
+ }
32
+
33
+ CrossDomainTracking.prototype.addLinkedTrackerDomain = function (element) {
34
+ var name = element.getAttribute('data-tracking-name')
35
+ var code = element.getAttribute('data-tracking-code')
36
+ var trackEvent = (element.getAttribute('data-tracking-track-event') === 'true')
37
+
38
+ if (window.GOVUK.analytics !== 'undefined') {
39
+ if (Modules.crossDomainLinkedTrackers.indexOf(name) === -1) {
40
+ var hostname = element.hostname
41
+ window.GOVUK.analytics.addLinkedTrackerDomain(code, name, hostname)
42
+ Modules.crossDomainLinkedTrackers.push(name)
43
+ }
44
+
45
+ if (trackEvent) {
46
+ element.addEventListener('click', function (e) {
47
+ var target = e.target
48
+ window.GOVUK.analytics.trackEvent('External Link Clicked', target.textContent, { trackerName: name })
49
+ })
50
+ }
51
+ }
52
+ }
53
+
54
+ Modules.CrossDomainTracking = CrossDomainTracking
55
+ })(window.GOVUK.Modules)
@@ -1,3 +1,5 @@
1
+ // these scripts are specifically ordered
2
+
1
3
  //= require govuk_publishing_components/lib/cookie-functions
2
4
  //= require govuk_publishing_components/lib/extend-object
3
5
  //= require ./analytics/pii
@@ -18,3 +20,4 @@
18
20
  //= require ./analytics/explicit-cross-domain-links
19
21
  //= require ./analytics/track-click
20
22
  //= require ./analytics/track-select-change
23
+ //= require ./analytics/cross-domain-tracking
@@ -19,6 +19,7 @@ $govuk-new-link-styles: true;
19
19
  @import "components/big-number";
20
20
  @import "components/breadcrumbs";
21
21
  @import "components/button";
22
+ @import "components/cards";
22
23
  @import "components/character-count";
23
24
  @import "components/checkboxes";
24
25
  @import "components/contents-list";
@@ -5,6 +5,7 @@
5
5
 
6
6
  @import "components/print/accordion";
7
7
  @import "components/print/button";
8
+ @import "components/print/cards";
8
9
  @import "components/print/contents-list";
9
10
  @import "components/print/govspeak-html-publication";
10
11
  @import "components/print/govspeak";
@@ -58,8 +58,9 @@ $thumbnail-icon-border-colour: govuk-colour("mid-grey", $legacy: "grey-3");
58
58
  }
59
59
 
60
60
  .gem-c-attachment__metadata {
61
- @include govuk-font($size: 14);
61
+ @include govuk-font($size: 19);
62
62
  margin: 0 0 govuk-spacing(3);
63
+ color: $govuk-secondary-text-colour;
63
64
 
64
65
  &:last-of-type {
65
66
  margin-bottom: 0;
@@ -0,0 +1,102 @@
1
+ @import "mixins/grid-helper";
2
+ @import "mixins/prefixed-transform";
3
+
4
+ .gem-c-cards__heading {
5
+ margin: 0 0 govuk-spacing(6) 0;
6
+ }
7
+
8
+ .gem-c-cards__list {
9
+ list-style: none;
10
+ padding: 0;
11
+ // Remove the outermost left and right margin from the internal margin of the list items.
12
+ margin: 0 govuk-spacing(-3);
13
+
14
+ display: grid;
15
+ grid-auto-flow: row;
16
+ // Use CSS grid to calculate the number of rows
17
+ grid-template-rows: auto;
18
+ // Use the tallest cell in the grid to set the height for all rows
19
+ grid-auto-rows: fractions(1);
20
+ grid-template-columns: fractions(1);
21
+
22
+ @include govuk-media-query($from: "tablet") {
23
+ grid-template-columns: fractions(2);
24
+ }
25
+
26
+ @include govuk-media-query($from: "desktop") {
27
+ // Note that browsers that don't support CSS grid display the component as one column on all
28
+ // breakpoints
29
+ grid-template-columns: fractions(3);
30
+
31
+ // For browsers that don't support CSS grid, constrain the width to 50% to improve usability
32
+ // especially for screen magnifier users
33
+ width: 50%;
34
+
35
+ // Reset the width for browsers that support CSS grid
36
+ @supports (display: grid) {
37
+ width: initial;
38
+ }
39
+ }
40
+ }
41
+
42
+ .gem-c-cards__list--two-column-desktop {
43
+ @include govuk-media-query($from: "desktop") {
44
+ grid-template-columns: fractions(2);
45
+ }
46
+ }
47
+
48
+ .gem-c-cards__list-item {
49
+ border-top: 1px solid $govuk-border-colour;
50
+ // We use grid to split the container into column widths, so manage the horizontal spacing with
51
+ // internal margins.
52
+ margin: 0 govuk-spacing(3);
53
+ padding: govuk-spacing(3) 0 govuk-spacing(6) 0;
54
+ position: relative;
55
+ }
56
+
57
+ .gem-c-cards__sub-heading {
58
+ margin: 0 govuk-spacing(6) govuk-spacing(2) 0;
59
+ }
60
+
61
+ .gem-c-cards__link {
62
+ // Make the entire list item area clickable
63
+ &:after {
64
+ bottom: 0;
65
+ content: "";
66
+ left: 0;
67
+ position: absolute;
68
+ right: 0;
69
+ top: 0;
70
+ }
71
+
72
+ &:before {
73
+ $dimension: 7px;
74
+ $width: 3px;
75
+
76
+ border-right: $width solid $govuk-brand-colour;
77
+ border-top: $width solid $govuk-brand-colour;
78
+ content: "";
79
+ height: $dimension;
80
+ position: absolute;
81
+ right: govuk-spacing(1);
82
+ top: govuk-spacing(4);
83
+ @include prefixed-transform($rotate: 45deg);
84
+ width: $dimension;
85
+ }
86
+
87
+ &:hover {
88
+ &:before {
89
+ border-color: $govuk-link-hover-colour;
90
+ }
91
+ }
92
+
93
+ &:focus {
94
+ &:before {
95
+ border-color: $govuk-focus-text-colour;
96
+ }
97
+ }
98
+ }
99
+
100
+ .gem-c-cards__description {
101
+ margin: 0;
102
+ }
@@ -1,5 +1,3 @@
1
- $transition-campaign-red: #ff003b;
2
-
3
1
  .gem-c-contextual-sidebar__related-links {
4
2
  border-top: 2px solid $govuk-brand-colour;
5
3
  }
@@ -19,13 +17,10 @@ $transition-campaign-red: #ff003b;
19
17
  }
20
18
 
21
19
  .gem-c-contextual-sidebar__cta {
20
+ border-top: 2px solid $govuk-brand-colour;
22
21
  margin-bottom: govuk-spacing(6);
23
22
  background-color: govuk-colour('light-grey', $legacy: 'grey-4');
24
23
  display: block;
25
24
  padding: 0 govuk-spacing(3) govuk-spacing(3);
26
25
  text-decoration: none;
27
26
  }
28
-
29
- .gem-c-contextual-sidebar__cta--brexit {
30
- border-top: 2px solid $transition-campaign-red;
31
- }
@@ -66,7 +66,8 @@
66
66
 
67
67
  .gem-c-document-list__attribute {
68
68
  @include govuk-text-colour;
69
- @include govuk-font(14);
69
+ @include govuk-font(16);
70
+ color: $govuk-secondary-text-colour;
70
71
  display: inline-block;
71
72
  list-style: none;
72
73
  padding-right: govuk-spacing(4);
@@ -9,7 +9,7 @@
9
9
  }
10
10
 
11
11
  .gem-c-pagination__item {
12
- @include govuk-font($size: 16, $line-height: (20 / 16));
12
+ @include govuk-font($size: 19);
13
13
  list-style: none;
14
14
 
15
15
  &:first-child {
@@ -1,6 +1,7 @@
1
1
  .gem-c-related-navigation {
2
2
  @include govuk-text-colour;
3
3
  border-top: 2px solid govuk-colour("blue");
4
+ margin-bottom: govuk-spacing(9);
4
5
  }
5
6
 
6
7
  .gem-c-related-navigation__main-heading {
@@ -9,7 +9,7 @@
9
9
  .govspeak, // Legacy class name that's still used in some content items - needs to be kept until `.govspeak` is removed from the content items.
10
10
  .gem-c-govspeak {
11
11
  .help-notice {
12
- $icon-size: 34px;
12
+ $icon-size: 35px;
13
13
  $line-height-mobile: 20px;
14
14
  $line-height-tablet: 25px;
15
15
 
@@ -0,0 +1,4 @@
1
+ .gem-c-cards__sub-heading {
2
+ margin-top: govuk-spacing(6);
3
+ margin-bottom: govuk-spacing(1);
4
+ }
@@ -0,0 +1,46 @@
1
+ <%
2
+ heading ||= nil
3
+ items ||= nil
4
+ sub_heading_level ||= 3
5
+ two_column_layout ||= false
6
+ local_assigns ||= nil
7
+ data_attributes ||= nil
8
+
9
+ ul_classes = %w[gem-c-cards__list]
10
+ ul_classes << 'gem-c-cards__list--two-column-desktop' if two_column_layout
11
+
12
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
13
+ %>
14
+ <% if items.present? %>
15
+ <div class="gem-c-cards">
16
+ <% if heading %>
17
+ <%= content_tag(shared_helper.get_heading_level, class: "gem-c-cards__heading govuk-heading-m") do %>
18
+ <%= heading %>
19
+ <% end %>
20
+ <% end %>
21
+
22
+ <%= content_tag('ul', class: ul_classes) do %>
23
+ <%
24
+ items.each do |item|
25
+ link = item[:link]
26
+
27
+ if !link[:path].present?
28
+ raise ArgumentError, "The cards component requires a href for all the links"
29
+ end
30
+ %>
31
+ <li class="gem-c-cards__list-item">
32
+ <%= content_tag("h#{sub_heading_level}", class: "gem-c-cards__sub-heading govuk-heading-s") do %>
33
+ <%=
34
+ link_to link[:text], link[:path],
35
+ class: "govuk-link gem-c-cards__link",
36
+ data: link[:data_attributes]
37
+ %>
38
+ <% end %>
39
+ <% if item[:description] %>
40
+ <p class="govuk-body gem-c-cards__description"><%= item[:description] %></p>
41
+ <% end %>
42
+ </li>
43
+ <% end %>
44
+ <% end %>
45
+ </div>
46
+ <% end %>
@@ -24,7 +24,7 @@
24
24
  } %>
25
25
  <% end %>
26
26
 
27
- <% if navigation.show_brexit_cta? %>
28
- <%= render 'govuk_publishing_components/components/contextual_sidebar/brexit_cta', content_item: content_item %>
27
+ <% if navigation.show_ukraine_cta? %>
28
+ <%= render 'govuk_publishing_components/components/contextual_sidebar/ukraine_cta', content_item: content_item %>
29
29
  <% end %>
30
30
  </div>
@@ -7,6 +7,7 @@
7
7
  describedby ||= nil
8
8
  enterkeyhint ||= nil
9
9
  id ||= "input-#{SecureRandom.hex(4)}"
10
+ spellcheck ||= "false"
10
11
  type ||= "text"
11
12
  value ||= nil
12
13
  inputmode ||= nil
@@ -63,6 +64,7 @@
63
64
  inputmode = "numeric"
64
65
  pattern = "[0-9]*"
65
66
  end
67
+
66
68
  %>
67
69
 
68
70
  <%= content_tag :div, class: form_group_css_classes do %>
@@ -114,6 +116,7 @@
114
116
  name: name,
115
117
  pattern: pattern,
116
118
  readonly: readonly,
119
+ spellcheck: spellcheck,
117
120
  tabindex: tabindex,
118
121
  type: type,
119
122
  value: value
@@ -9,7 +9,6 @@
9
9
  classes << "gem-c-lead-paragraph--inverse" if inverse
10
10
  classes << custom_margin_bottom_class if local_assigns[:margin_bottom]
11
11
  %>
12
-
13
12
  <% if text.present? %>
14
13
  <%= content_tag :p, text, class: classes %>
15
14
  <% end %>
@@ -32,12 +32,10 @@
32
32
 
33
33
  <% if delete.any? %>
34
34
  <% delete_main_link = capture do %>
35
- <%
36
- delete_section_link_text = delete[:link_text] || t("components.summary_list.delete")
37
- %>
35
+ <% delete_section_link_text = delete[:link_text] || t("components.summary_list.delete") %>
38
36
  <%= link_to delete.fetch(:href),
39
- class: "govuk-link gem-link--destructive",
40
- data: delete.fetch(:data_attributes, {}) do %>
37
+ class: "govuk-link gem-link--destructive",
38
+ data: delete.fetch(:data_attributes, {}) do %>
41
39
  <%= delete_section_link_text %><%= tag.span " #{title}", class: "govuk-visually-hidden" unless delete[:link_text_no_enhance] -%>
42
40
  <% end %>
43
41
  <% end %>
@@ -62,39 +60,46 @@
62
60
  <%= delete_main_link %>
63
61
  <% end %>
64
62
  <% end %>
65
-
66
63
  <% end %>
67
64
 
65
+ <% any_body_actions = items.detect { |item| item.has_key?("edit") || item.has_key?("delete") } %>
68
66
  <% if items.any? %>
69
67
  <%= tag.dl class: "govuk-summary-list" do %>
70
68
  <% items.each do |item| %>
71
- <%= tag.div class: "govuk-summary-list__row" do %>
69
+ <%
70
+ item_body_actions = (item.fetch(:edit, {}).any? || item.fetch(:delete, {}).any?)
71
+
72
+ if any_body_actions.present? && !item_body_actions.present?
73
+ classes = "govuk-summary-list__row govuk-summary-list__row--no-actions"
74
+ else
75
+ classes = "govuk-summary-list__row"
76
+ end
77
+ %>
78
+ <%= tag.div class: classes do %>
72
79
 
73
80
  <%= tag.dt item[:field], class: "govuk-summary-list__key" %>
74
81
  <%= tag.dd item[:value], class: "govuk-summary-list__value" %>
75
82
 
76
83
  <% if item.fetch(:edit, {}).any? %>
77
84
  <% edit_link = capture do %>
78
- <%
79
- edit_link_text = item[:edit][:link_text] || t("components.summary_list.edit")
80
- %>
85
+ <% edit_link_text = item[:edit][:link_text] || t("components.summary_list.edit") %>
81
86
  <%= link_to item[:edit].fetch(:href),
82
- class: "govuk-link",
83
- data: item[:edit].fetch(:data_attributes, {}) do %>
84
- <%= edit_link_text %><%= tag.span " #{item[:field]}", class: "govuk-visually-hidden" unless item[:edit][:link_text_no_enhance] -%>
87
+ class: "govuk-link",
88
+ data: item[:edit].fetch(:data_attributes, {}) do %>
89
+ <%= edit_link_text %>
90
+ <%= tag.span " #{item[:field]}", class: "govuk-visually-hidden" unless item[:edit][:link_text_no_enhance] -%>
85
91
  <% end %>
86
92
  <% end %>
87
93
  <% end %>
88
94
 
89
95
  <% if item.fetch(:delete, {}).any? %>
90
96
  <% delete_link = capture do %>
91
- <%
92
- delete_link_text = item[:delete][:link_text] || t("components.summary_list.delete")
93
- %>
97
+ <% delete_link_text = item[:delete][:link_text] || t("components.summary_list.delete") %>
94
98
  <%= link_to item[:delete].fetch(:href),
95
- class: "govuk-link gem-link--destructive",
96
- data: item[:delete].fetch(:data_attributes, {}) do %>
97
- <%= delete_link_text %><%= tag.span " #{item[:field]}", class: "govuk-visually-hidden" unless item[:delete][:link_text_no_enhance] -%>
99
+ class: "govuk-link gem-link--destructive",
100
+ data: item[:delete].fetch(:data_attributes, {}) do %>
101
+ <%= delete_link_text %>
102
+ <%= tag.span " #{item[:field]}", class: "govuk-visually-hidden" unless item[:delete][:link_text_no_enhance] -%>
98
103
  <% end %>
99
104
  <% end %>
100
105
  <% end %>
@@ -115,17 +120,17 @@
115
120
  <% end %>
116
121
  <% end %>
117
122
  <% else %>
123
+ <% if edit_link || delete_link %>
118
124
  <%= tag.dd class: "govuk-summary-list__actions" do %>
119
125
  <%= edit_link %>
120
126
  <%= delete_link %>
121
127
  <% end %>
122
128
  <% end %>
123
-
124
129
  <% end %>
125
130
  <% end %>
126
131
  <% end %>
127
132
  <% end %>
128
-
129
- <%= tag.div block, class: "gem-c-summary__block" if block %>
130
133
  <% end %>
134
+ <%= tag.div block, class: "gem-c-summary__block" if block %>
135
+ <% end %>
131
136
  <% end %>
@@ -1,21 +1,21 @@
1
1
  <% shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns) %>
2
2
  <%
3
- title = t("components.related_navigation.transition.title")
4
- link_text = t("components.related_navigation.transition.link_text")
5
- link_path = t("components.related_navigation.transition.link_path")
6
- lang = shared_helper.t_locale("components.related_navigation.transition.title")
3
+ title = t("components.related_navigation.ukraine.title")
4
+ link_text = t("components.related_navigation.ukraine.link_text")
5
+ link_path = t("components.related_navigation.ukraine.link_path")
6
+ lang = shared_helper.t_locale("components.related_navigation.ukraine.title")
7
7
  %>
8
8
 
9
9
  <% data_attributes = {
10
10
  "module": "gem-track-click",
11
11
  "track-category": "relatedLinkClicked",
12
- "track-action": "1.0 Transition",
12
+ "track-action": "1.0 Invasion of Ukraine",
13
13
  "track-label": link_path,
14
14
  "track-dimension": link_text,
15
15
  "track-dimension-index": "29",
16
16
  } %>
17
17
 
18
- <%= tag.div class: "gem-c-contextual-sidebar__cta gem-c-contextual-sidebar__cta--brexit" do %>
18
+ <%= tag.div class: "gem-c-contextual-sidebar__cta" do %>
19
19
  <%= tag.h2 title, class: "gem-c-contextual-sidebar__heading govuk-heading-s" %>
20
20
  <%= tag.p class: "gem-c-contextual-sidebar__text govuk-body" do %>
21
21
  <%= link_to link_text,
@@ -86,7 +86,7 @@ examples:
86
86
  file_size: 20000
87
87
  owning_document_content_id: 456_abc
88
88
  attachment_id: 123
89
- alternative_format_contact_email: alternative.formats@education.gov.uk
89
+ alternative_format_contact_email: govuk_publishing_components@example.com
90
90
  with_data_attributes:
91
91
  data:
92
92
  attachment:
@@ -0,0 +1,145 @@
1
+ name: Cards (experimental)
2
+ description: A grid of cards that have a link and a description
3
+ body: |
4
+ The component renders the cards as an unordered list element and visually presents it as a grid. It doesn't use the [GOV.UK Design System grid](https://design-system.service.gov.uk/styles/layout/#grid-system) but sets its own so that it can separately target desktop, tablet and mobile columns.
5
+
6
+ You can display the grid in three or two columns on desktop. Browsers that don't support CSS grid always display one column.
7
+
8
+ You must set a `href` for all the links.
9
+
10
+ This component is currently experimental. If you are using it, please feed back any research findings to the GOV.UK Explore team.
11
+ accessibility_criteria: |
12
+ The component must:
13
+
14
+ - use the correct heading level hierarchy eg. if the component heading uses a `<h2>`, the subheadings must use a `<h3>`
15
+
16
+ It is also good practise to include a heading above the list to tell users what the list contains
17
+ shared_accessibility_criteria:
18
+ - link
19
+ examples:
20
+ default:
21
+ data:
22
+ heading: Topics
23
+ items:
24
+ - link:
25
+ text: Benefits
26
+ path: http://www.gov.uk
27
+ description: Includes eligibility, appeals, tax credits and Universal Credit
28
+ - link:
29
+ text: Births, deaths, marriages and&nbsp;care
30
+ path: http://www.gov.uk
31
+ description: Parenting, civil partnerships, divorce and Lasting Power of Attorney
32
+ - link:
33
+ text: Business and self-employed
34
+ path: http://www.gov.uk
35
+ description: Tools and guidance for businesses
36
+ - link:
37
+ text: Childcare and parenting
38
+ path: http://www.gov.uk
39
+ description: Includes giving birth, fostering, adopting, benefits for children, childcare and schools
40
+ - link:
41
+ text: Citizenship and living in the&nbsp;UK
42
+ path: http://www.gov.uk
43
+ description: Voting, community participation, life in the UK, international projects
44
+ - link:
45
+ text: Crime, justice and the&nbsp;law
46
+ path: http://www.gov.uk
47
+ description: Legal processes, courts and the police
48
+ - link:
49
+ text: Disabled people
50
+ path: http://www.gov.uk
51
+ description: Includes carers, your rights, benefits and the Equality Act
52
+ - link:
53
+ text: Driving and transport
54
+ path: http://www.gov.uk
55
+ description: Includes vehicle tax, MOT and driving licences
56
+ - link:
57
+ text: Education and learning
58
+ path: http://www.gov.uk
59
+ description: Includes student loans, admissions and apprenticeships
60
+ - link:
61
+ text: Employing people
62
+ path: http://www.gov.uk
63
+ description: Includes pay, contracts, hiring and redundancies
64
+ - link:
65
+ text: Environment and countryside
66
+ path: http://www.gov.uk
67
+ description: Includes flooding, recycling and wildlife
68
+ - link:
69
+ text: Housing and local services
70
+ path: http://www.gov.uk
71
+ description: Owning or renting and council services
72
+ two_column_layout:
73
+ description: Override default three column layout on desktop by passing through `two_column_layout` parameter (defaults to `false`).
74
+ data:
75
+ two_column_layout: true
76
+ items:
77
+ - link:
78
+ text: Benefits
79
+ path: http://www.gov.uk
80
+ description: Includes eligibility, appeals, tax credits and Universal Credit
81
+ - link:
82
+ text: Births, deaths, marriages and&nbsp;care
83
+ path: http://www.gov.uk
84
+ description: Parenting, civil partnerships, divorce and Lasting Power of Attorney
85
+ - link:
86
+ text: Business and self-employed
87
+ path: http://www.gov.uk
88
+ description: Tools and guidance for businesses
89
+ - link:
90
+ text: Childcare and parenting
91
+ path: http://www.gov.uk
92
+ description: Includes giving birth, fostering, adopting, benefits for children, childcare and schools
93
+ - link:
94
+ text: Citizenship and living in the&nbsp;UK
95
+ path: http://www.gov.uk
96
+ description: Voting, community participation, life in the UK, international projects
97
+ - link:
98
+ text: Crime, justice and the&nbsp;law
99
+ path: http://www.gov.uk
100
+ description: Legal processes, courts and the police
101
+ - link:
102
+ text: Disabled people
103
+ path: http://www.gov.uk
104
+ description: Includes carers, your rights, benefits and the Equality Act
105
+ custom_heading_levels:
106
+ description: |
107
+ Override default heading level by passing through `heading_level` parameter (defaults to `<h2>`).
108
+
109
+ Override default subheading level by passing through `sub_heading_level` parameter (defaults to `<h3>`)
110
+ data:
111
+ heading: Topics
112
+ heading_level: 3
113
+ sub_heading_level: 4
114
+ items:
115
+ - link:
116
+ text: Benefits
117
+ path: http://www.gov.uk
118
+ description: Includes eligibility, appeals, tax credits and Universal Credit
119
+ with_data_attributes:
120
+ description: |
121
+ Data attributes can be passed to individual links within the component as shown.
122
+ data:
123
+ items:
124
+ - link:
125
+ text: Benefits
126
+ path: http://www.gov.uk
127
+ data_attributes:
128
+ track_category: homepageClicked
129
+ track_action: track-action
130
+ track_label: track-label
131
+ track_dimension: track-dimension
132
+ track_dimension_index: 29
133
+ track_value: 9
134
+ description: Includes eligibility, appeals, tax credits and Universal Credit
135
+ - link:
136
+ text: Births, deaths, marriages and&nbsp;care
137
+ path: http://www.gov.uk
138
+ data_attributes:
139
+ track_category: homepageClicked
140
+ track_action: track-action
141
+ track_label: track-label
142
+ track_dimension: track-dimension
143
+ track_dimension_index: 29
144
+ track_value: 9
145
+ description: Parenting, civil partnerships, divorce and Lasting Power of Attorney