govuk_publishing_components 35.6.0 → 35.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (101) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/component_guide/audit-filter.js +45 -0
  3. data/app/assets/javascripts/govuk_publishing_components/vendor/lux/lux-reporter.js +206 -114
  4. data/app/assets/stylesheets/component_guide/application.scss +0 -25
  5. data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +5 -9
  6. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +4 -0
  7. data/app/views/govuk_publishing_components/audit/_component_contents.html.erb +37 -49
  8. data/app/views/govuk_publishing_components/audit/show.html.erb +2 -1
  9. data/app/views/govuk_publishing_components/components/_attachment.html.erb +38 -18
  10. data/app/views/govuk_publishing_components/components/_character_count.html.erb +4 -2
  11. data/app/views/govuk_publishing_components/components/_document_list.html.erb +8 -7
  12. data/app/views/govuk_publishing_components/components/_feedback.html.erb +1 -0
  13. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +9 -2
  14. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +1 -0
  15. data/app/views/govuk_publishing_components/components/_metadata.html.erb +20 -14
  16. data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -0
  17. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
  18. data/app/views/govuk_publishing_components/components/_select.html.erb +1 -0
  19. data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +2 -2
  20. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_document.html.erb +1 -1
  21. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_generic.html.erb +1 -1
  22. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_html.html.erb +3 -0
  23. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_spreadsheet.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/docs/attachment.yml +21 -0
  25. data/app/views/govuk_publishing_components/components/docs/document_list.yml +17 -0
  26. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +6 -0
  27. data/app/views/layouts/govuk_publishing_components/application.html.erb +23 -20
  28. data/config/locales/ar.yml +1 -0
  29. data/config/locales/az.yml +1 -0
  30. data/config/locales/be.yml +1 -0
  31. data/config/locales/bg.yml +1 -0
  32. data/config/locales/bn.yml +1 -0
  33. data/config/locales/cs.yml +1 -0
  34. data/config/locales/cy.yml +1 -0
  35. data/config/locales/da.yml +1 -0
  36. data/config/locales/de.yml +1 -0
  37. data/config/locales/dr.yml +1 -0
  38. data/config/locales/el.yml +1 -0
  39. data/config/locales/en.yml +1 -0
  40. data/config/locales/es-419.yml +1 -0
  41. data/config/locales/es.yml +1 -0
  42. data/config/locales/et.yml +1 -0
  43. data/config/locales/fa.yml +1 -0
  44. data/config/locales/fi.yml +1 -0
  45. data/config/locales/fr.yml +1 -0
  46. data/config/locales/gd.yml +1 -0
  47. data/config/locales/gu.yml +1 -0
  48. data/config/locales/he.yml +1 -0
  49. data/config/locales/hi.yml +1 -0
  50. data/config/locales/hr.yml +1 -0
  51. data/config/locales/hu.yml +1 -0
  52. data/config/locales/hy.yml +1 -0
  53. data/config/locales/id.yml +1 -0
  54. data/config/locales/is.yml +1 -0
  55. data/config/locales/it.yml +1 -0
  56. data/config/locales/ja.yml +1 -0
  57. data/config/locales/ka.yml +1 -0
  58. data/config/locales/kk.yml +1 -0
  59. data/config/locales/ko.yml +1 -0
  60. data/config/locales/lt.yml +1 -0
  61. data/config/locales/lv.yml +1 -0
  62. data/config/locales/ms.yml +1 -0
  63. data/config/locales/mt.yml +1 -0
  64. data/config/locales/nl.yml +1 -0
  65. data/config/locales/no.yml +1 -0
  66. data/config/locales/pa-pk.yml +1 -0
  67. data/config/locales/pa.yml +1 -0
  68. data/config/locales/pl.yml +1 -0
  69. data/config/locales/ps.yml +1 -0
  70. data/config/locales/pt.yml +1 -0
  71. data/config/locales/ro.yml +1 -0
  72. data/config/locales/ru.yml +1 -0
  73. data/config/locales/si.yml +1 -0
  74. data/config/locales/sk.yml +1 -0
  75. data/config/locales/sl.yml +1 -0
  76. data/config/locales/so.yml +1 -0
  77. data/config/locales/sq.yml +1 -0
  78. data/config/locales/sr.yml +1 -0
  79. data/config/locales/sv.yml +1 -0
  80. data/config/locales/sw.yml +1 -0
  81. data/config/locales/ta.yml +1 -0
  82. data/config/locales/th.yml +1 -0
  83. data/config/locales/tk.yml +1 -0
  84. data/config/locales/tr.yml +1 -0
  85. data/config/locales/uk.yml +1 -0
  86. data/config/locales/ur.yml +1 -0
  87. data/config/locales/uz.yml +1 -0
  88. data/config/locales/vi.yml +1 -0
  89. data/config/locales/zh-hk.yml +1 -0
  90. data/config/locales/zh-tw.yml +1 -0
  91. data/config/locales/zh.yml +1 -0
  92. data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +5 -1
  93. data/lib/govuk_publishing_components/presenters/attachment_helper.rb +15 -3
  94. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +5 -0
  95. data/lib/govuk_publishing_components/version.rb +1 -1
  96. data/node_modules/axe-core/README.md +4 -0
  97. data/node_modules/axe-core/axe.js +25 -19
  98. data/node_modules/axe-core/axe.min.js +2 -2
  99. data/node_modules/axe-core/package.json +1 -1
  100. data/node_modules/axe-core/sri-history.json +4 -0
  101. metadata +4 -3
@@ -8,10 +8,14 @@
8
8
  }
9
9
 
10
10
  .gem-c-document-list__item {
11
- margin-bottom: govuk-spacing(5);
11
+ margin-top: govuk-spacing(5);
12
12
  padding-top: govuk-spacing(2);
13
13
  border-top: 1px solid $govuk-border-colour;
14
14
  list-style: none;
15
+
16
+ &:first-child {
17
+ margin-top: 0;
18
+ }
15
19
  }
16
20
 
17
21
  .gem-c-document-list__item-title {
@@ -86,14 +90,6 @@
86
90
  }
87
91
  }
88
92
 
89
- .gem-c-document-list--bottom-margin {
90
- margin-bottom: govuk-spacing(4);
91
- }
92
-
93
- .gem-c-document-list--top-margin {
94
- margin-top: govuk-spacing(4);
95
- }
96
-
97
93
  .gem-c-document-list__multi-list {
98
94
  width: 100%;
99
95
  margin-right: 25px;
@@ -9,6 +9,10 @@
9
9
  height: govuk-spacing(2);
10
10
  }
11
11
 
12
+ .gem-c-layout-for-public__blue-bar-wrapper--browse {
13
+ background-color: #263135;
14
+ }
15
+
12
16
  .js-enabled .gem-c-layout-for-public__global-banner-wrapper {
13
17
  margin-top: - govuk-spacing(2);
14
18
  min-height: govuk-spacing(2);
@@ -1,7 +1,7 @@
1
- <table class="govuk-table" <% if show_application_name %>data-audit-list<% end %>>
1
+ <table class="govuk-table">
2
2
  <thead class="govuk-table__head">
3
- <tr class="govuk-table__row">
4
- <th scope="col" class="govuk-table__header sticky-table-header">Component</th>
3
+ <tr class="govuk-table__row" <% if show_application_name %>data-audit-headings<% end %>>
4
+ <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="total">Component</th>
5
5
  <th scope="col" class="govuk-table__header sticky-table-header" data-component-type="template">
6
6
  Template
7
7
  <% unless show_application_name %>
@@ -46,10 +46,10 @@
46
46
  </th>
47
47
  </tr>
48
48
  </thead>
49
- <tbody class="govuk-table__body">
49
+ <tbody class="govuk-table__body" <% if show_application_name %>data-audit-list<% end %>>
50
50
  <% passed_components[:component_file_details].each do |component| %>
51
51
  <tr class="govuk-table__row" data-application="<%= component[:application] %>">
52
- <th scope="row" class="govuk-table__header">
52
+ <th scope="row" class="govuk-table__header" data-component-type="total">
53
53
  <% if component[:link] %>
54
54
  <a href="<%= component[:link] %>" class="govuk-link">
55
55
  <%= component[:name] %>
@@ -63,69 +63,57 @@
63
63
  </span>
64
64
  <% end %>
65
65
  </th>
66
- <td class="govuk-table__cell">
66
+ <td class="govuk-table__cell" data-component-type="template">
67
67
  <% if component[:template_exists] %>
68
- <strong class="govuk-tag govuk-tag--green">
69
- <a href="<%= component[:template_link] %>" class="govuk-link">
70
- <%= component[:template_lines] %>
71
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> template</span>
72
- </a>
73
- </strong>
68
+ <a href="<%= component[:template_link] %>" class="govuk-link">
69
+ <%= component[:template_lines] %>
70
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> template</span>
71
+ </a>
74
72
  <% end %>
75
73
  </td>
76
- <td class="govuk-table__cell">
74
+ <td class="govuk-table__cell" data-component-type="stylesheet">
77
75
  <% if component[:stylesheet_exists] %>
78
- <strong class="govuk-tag govuk-tag--green">
79
- <a href="<%= component[:stylesheet_link] %>" class="govuk-link">
80
- <%= component[:stylesheet_lines] %>
81
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> stylesheet</span>
82
- </a>
83
- </strong>
76
+ <a href="<%= component[:stylesheet_link] %>" class="govuk-link">
77
+ <%= component[:stylesheet_lines] %>
78
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> stylesheet</span>
79
+ </a>
84
80
  <% end %>
85
81
  </td>
86
- <td class="govuk-table__cell">
82
+ <td class="govuk-table__cell" data-component-type="print_stylesheet">
87
83
  <% if component[:print_stylesheet_exists] %>
88
- <strong class="govuk-tag govuk-tag--green">Yes</strong>
84
+ Yes
89
85
  <% end %>
90
86
  </td>
91
- <td class="govuk-table__cell">
87
+ <td class="govuk-table__cell" data-component-type="javascript">
92
88
  <% if component[:javascript_exists] %>
93
- <strong class="govuk-tag govuk-tag--green">
94
- <a href="<%= component[:javascript_link] %>" class="govuk-link">
95
- <%= component[:javascript_lines] %>
96
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> javascript</span>
97
- </a>
98
- </strong>
89
+ <a href="<%= component[:javascript_link] %>" class="govuk-link">
90
+ <%= component[:javascript_lines] %>
91
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> javascript</span>
92
+ </a>
99
93
  <% end %>
100
94
  </td>
101
- <td class="govuk-table__cell">
95
+ <td class="govuk-table__cell" data-component-type="test">
102
96
  <% if component[:test_exists] %>
103
- <strong class="govuk-tag govuk-tag--green">
104
- <a href="<%= component[:test_link] %>" class="govuk-link">
105
- <%= component[:test_lines] %>
106
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> test</span>
107
- </a>
108
- </strong>
97
+ <a href="<%= component[:test_link] %>" class="govuk-link">
98
+ <%= component[:test_lines] %>
99
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> test</span>
100
+ </a>
109
101
  <% end %>
110
102
  </td>
111
- <td class="govuk-table__cell">
103
+ <td class="govuk-table__cell" data-component-type="javascript_test">
112
104
  <% if component[:javascript_test_exists] %>
113
- <strong class="govuk-tag govuk-tag--green">
114
- <a href="<%= component[:javascript_test_link] %>" class="govuk-link">
115
- <%= component[:javascript_test_lines] %>
116
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> javascript test</span>
117
- </a>
118
- </strong>
105
+ <a href="<%= component[:javascript_test_link] %>" class="govuk-link">
106
+ <%= component[:javascript_test_lines] %>
107
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> javascript test</span>
108
+ </a>
119
109
  <% end %>
120
110
  </td>
121
- <td class="govuk-table__cell">
111
+ <td class="govuk-table__cell" data-component-type="helper">
122
112
  <% if component[:helper_exists] %>
123
- <strong class="govuk-tag govuk-tag--green">
124
- <a href="<%= component[:helper_link] %>" class="govuk-link">
125
- <%= component[:helper_lines] %>
126
- <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> helper</span>
127
- </a>
128
- </strong>
113
+ <a href="<%= component[:helper_link] %>" class="govuk-link">
114
+ <%= component[:helper_lines] %>
115
+ <span class="govuk-visually-hidden">lines of code in <%= component[:name] %> helper</span>
116
+ </a>
129
117
  <% end %>
130
118
  </td>
131
119
  </tr>
@@ -1,6 +1,7 @@
1
- <%
1
+ <%
2
2
  add_gem_component_stylesheet("table")
3
3
  add_gem_component_stylesheet("select")
4
+ add_gem_component_stylesheet("summary-list")
4
5
  %>
5
6
 
6
7
  <% content_for :title, "Component audit" %>
@@ -9,30 +9,44 @@
9
9
  data_attributes ||= {}
10
10
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
11
11
 
12
- if attachment.content_type_name
13
- content = if attachment.content_type_abbr
14
- raw tag.abbr(attachment.content_type.abbr,
15
- title: attachment.content_type_name,
16
- class: "gem-c-attachment__abbr")
17
- else
18
- attachment.content_type_name
19
- end
20
- attributes << tag.span(content, class: "gem-c-attachment__attribute")
21
- end
12
+ case attachment.type
13
+ when "file"
14
+ if attachment.content_type_name
15
+ content = if attachment.content_type_abbr
16
+ raw tag.abbr(attachment.content_type.abbr,
17
+ title: attachment.content_type_name,
18
+ class: "gem-c-attachment__abbr")
19
+ else
20
+ attachment.content_type_name
21
+ end
22
+ attributes << tag.span(content, class: "gem-c-attachment__attribute")
23
+ end
24
+
25
+ if attachment.file_size
26
+ attributes << tag.span(
27
+ number_to_human_size(attachment.file_size),
28
+ class: "gem-c-attachment__attribute",
29
+ )
30
+ end
22
31
 
23
- if attachment.file_size
32
+ if attachment.number_of_pages
33
+ attributes << tag.span(
34
+ t("components.attachment.page", count: attachment.number_of_pages),
35
+ class: "gem-c-attachment__attribute",
36
+ )
37
+ end
38
+ when "html"
24
39
  attributes << tag.span(
25
- number_to_human_size(attachment.file_size),
40
+ "HTML",
26
41
  class: "gem-c-attachment__attribute",
27
42
  )
28
- end
29
-
30
- if attachment.number_of_pages
43
+ when "external"
31
44
  attributes << tag.span(
32
- t("components.attachment.page", count: attachment.number_of_pages),
45
+ attachment.url,
33
46
  class: "gem-c-attachment__attribute",
34
47
  )
35
48
  end
49
+
36
50
  %>
37
51
  <%= tag.section class: "gem-c-attachment govuk-!-display-none-print" do %>
38
52
  <%= tag.div class: "gem-c-attachment__thumbnail" do %>
@@ -42,8 +56,10 @@
42
56
  tabindex: "-1",
43
57
  "aria-hidden": true,
44
58
  data: data_attributes do %>
45
- <% if attachment.thumbnail_url %>
46
- <% image_tag(attachment.thumbnail_url, alt: "") %>
59
+ <% if attachment.thumbnail_url.present? %>
60
+ <% image_tag(attachment.thumbnail_url, alt: "", class: "gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--custom") %>
61
+ <% elsif attachment.html? %>
62
+ <%= render "govuk_publishing_components/components/attachment/thumbnail_html" %>
47
63
  <% elsif attachment.document? %>
48
64
  <%= render "govuk_publishing_components/components/attachment/thumbnail_document" %>
49
65
  <% elsif attachment.spreadsheet? %>
@@ -74,6 +90,10 @@
74
90
  <%= tag.p raw(attributes.join(', ')), class: "gem-c-attachment__metadata" %>
75
91
  <% end %>
76
92
 
93
+ <% if attachment.preview_url.present? %>
94
+ <%= tag.p link_to(t("components.attachment.preview_link"), attachment.preview_url, class: "govuk-link"), class: "gem-c-attachment__metadata" %>
95
+ <% end %>
96
+
77
97
  <% if attachment.is_official_document && !hide_order_copy_link %>
78
98
  <%= 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"),
79
99
  class: "gem-c-attachment__metadata" %>
@@ -1,6 +1,4 @@
1
1
  <%
2
- add_gem_component_stylesheet("character-count")
3
-
4
2
  id ||= "character-count-#{SecureRandom.hex(4)}"
5
3
  maxlength ||= nil
6
4
  maxwords ||= nil
@@ -24,3 +22,7 @@
24
22
  </div>
25
23
  <% end %>
26
24
  <% end %>
25
+ <%
26
+ add_gem_component_stylesheet("error-message")
27
+ add_gem_component_stylesheet("character-count")
28
+ %>
@@ -1,14 +1,15 @@
1
1
  <%
2
2
  add_gem_component_stylesheet("document-list")
3
3
 
4
+ local_assigns[:margin_bottom] ||= 5
5
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
4
6
  items ||= []
5
7
 
6
- classes = "gem-c-document-list"
7
- classes << " gem-c-document-list--top-margin" if local_assigns[:margin_top]
8
- classes << " gem-c-document-list--bottom-margin" if local_assigns[:margin_bottom]
9
- classes << " gem-c-document-list--no-underline" if local_assigns[:remove_underline]
10
- classes << " gem-c-document-list--no-top-border" if local_assigns[:remove_top_border]
11
- classes << " gem-c-document-list--no-top-border-first-child" if local_assigns[:remove_top_border_from_first_child]
8
+ classes = %w[gem-c-document-list]
9
+ classes << "gem-c-document-list--no-underline" if local_assigns[:remove_underline]
10
+ classes << "gem-c-document-list--no-top-border" if local_assigns[:remove_top_border]
11
+ classes << "gem-c-document-list--no-top-border-first-child" if local_assigns[:remove_top_border_from_first_child]
12
+ classes << shared_helper.get_margin_bottom
12
13
 
13
14
  within_multitype_list ||= false
14
15
  within_multitype_list_class = " gem-c-document-list__multi-list" if within_multitype_list
@@ -19,7 +20,7 @@
19
20
  %>
20
21
  <% if items.any? %>
21
22
  <% unless within_multitype_list %>
22
- <ul class="<%= classes %>">
23
+ <ul class="<%= classes.join(" ") %>">
23
24
  <% end %>
24
25
  <% items.each do |item| %>
25
26
  <% highlight_class = " gem-c-document-list__item--highlight" if item[:highlight] %>
@@ -1,4 +1,5 @@
1
1
  <%
2
+ add_gem_component_stylesheet("button")
2
3
  add_gem_component_stylesheet("feedback")
3
4
 
4
5
  def utf_encode(element)
@@ -3,9 +3,11 @@
3
3
 
4
4
  emergency_banner ||= nil
5
5
  full_width ||= false
6
+ blue_bar ||= local_assigns.include?(:blue_bar) ? local_assigns[:blue_bar] : !full_width
6
7
  global_bar ||= nil
7
8
  html_lang ||= "en"
8
9
  layout_helper = GovukPublishingComponents::Presenters::PublicLayoutHelper.new(local_assigns)
10
+ blue_bar_background_colour = layout_helper.blue_bar_background_colours.include?(blue_bar_background_colour) ? blue_bar_background_colour : nil
9
11
  logo_link ||= "/"
10
12
  navigation_items ||= []
11
13
  omit_feedback_form ||= false
@@ -44,6 +46,9 @@
44
46
  blue_bar_dedupe = !full_width && global_bar.present?
45
47
  body_css_classes = %w(gem-c-layout-for-public govuk-template__body)
46
48
  body_css_classes << "draft" if draft_watermark
49
+
50
+ blue_bar_wrapper_classes = %w()
51
+ blue_bar_wrapper_classes << "gem-c-layout-for-public__blue-bar-wrapper--#{blue_bar_background_colour}" if blue_bar_background_colour
47
52
  -%>
48
53
  <!DOCTYPE html>
49
54
  <!--[if lt IE 9]><html class="lte-ie8 govuk-template" lang="<%= html_lang %>"><![endif]-->
@@ -117,8 +122,10 @@
117
122
 
118
123
  <%= raw(emergency_banner) %>
119
124
 
120
- <% unless full_width %>
121
- <div class="gem-c-layout-for-public__blue-bar govuk-width-container"></div>
125
+ <% if (blue_bar && !global_bar.present?) || (blue_bar_dedupe) %>
126
+ <%= content_tag(:div, class: blue_bar_wrapper_classes) do %>
127
+ <div class="gem-c-layout-for-public__blue-bar govuk-width-container"></div>
128
+ <% end %>
122
129
  <% end %>
123
130
 
124
131
  <% if global_bar.present? %>
@@ -1,4 +1,5 @@
1
1
  <%
2
+ add_gem_component_stylesheet("layout-header")
2
3
  add_gem_component_stylesheet("layout-super-navigation-header")
3
4
 
4
5
  logo_link ||= "https://www.gov.uk/"
@@ -20,6 +20,11 @@
20
20
  classes << shared_helper.get_margin_bottom if local_assigns[:margin_bottom]
21
21
 
22
22
  ga4_tracking ||= false
23
+ ga4_object = {
24
+ event_name: "navigation",
25
+ type: "content",
26
+ section: "Top"
27
+ }.to_json
23
28
  %>
24
29
  <%= content_tag :div, class: classes, data: { module: "gem-toggle metadata" } do %>
25
30
  <dl class="gem-c-metadata__list" data-module="gem-track-click">
@@ -48,19 +53,15 @@
48
53
  <dd class="gem-c-metadata__definition">
49
54
  <%= last_updated %>
50
55
  <% if local_assigns.include?(:see_updates_link) %>
51
- &#8212; <a href="#full-publication-update-history" class="gem-c-metadata__definition-link govuk-!-display-none-print js-see-all-updates-link"
52
- data-track-category="content-history"
53
- data-track-action="see-all-updates-link-clicked"
54
- data-track-label="history"
55
- <% if ga4_tracking %>
56
- data-module="ga4-link-tracker"
57
- data-ga4-link="<%= {
58
- event_name: "navigation",
59
- type: "content",
60
- section: "Top"
61
- }.to_json %>"
62
- <% end%>
63
- >
56
+ &#8212; <a href="#full-publication-update-history"
57
+ class="gem-c-metadata__definition-link govuk-!-display-none-print js-see-all-updates-link"
58
+ data-track-category="content-history"
59
+ data-track-action="see-all-updates-link-clicked"
60
+ data-track-label="history"
61
+ <% if ga4_tracking %>
62
+ data-module="ga4-link-tracker"
63
+ data-ga4-link="<%= ga4_object %>"
64
+ <% end%>>
64
65
  <%= t("components.metadata.see_all_updates") %>
65
66
  </a>
66
67
  <% end %>
@@ -74,7 +75,12 @@
74
75
  %>
75
76
  <% if definition.any? %>
76
77
  <dt class="gem-c-metadata__term"><%= title %>:</dt>
77
- <dd class="gem-c-metadata__definition">
78
+ <dd class="gem-c-metadata__definition"
79
+ <% if ga4_tracking %>
80
+ data-module="ga4-link-tracker"
81
+ data-ga4-track-links-only
82
+ data-ga4-link="<%= ga4_object %>"
83
+ <% end%>>
78
84
  <%= render 'govuk_publishing_components/components/metadata/sentence', items: definition, toggle_id: "#{index}-#{SecureRandom.hex(4)}" %>
79
85
  </dd>
80
86
  <% end %>
@@ -1,4 +1,5 @@
1
1
  <%
2
+ add_gem_component_stylesheet("label")
2
3
  add_gem_component_stylesheet("radio")
3
4
 
4
5
  local_assigns[:margin_bottom] ||= 6
@@ -49,6 +49,7 @@
49
49
 
50
50
  <div class="<%= classes.join(" ") %>" data-module="gem-toggle-input-class-on-focus">
51
51
  <% if wrap_label_in_a_heading %>
52
+ <% add_gem_component_stylesheet("label") %>
52
53
  <%= content_tag(shared_helper.get_heading_level, class: "govuk-!-margin-0") do %>
53
54
  <%= tag_label %>
54
55
  <% end %>
@@ -17,6 +17,7 @@
17
17
  <% if select_helper.options.any? && id && label %>
18
18
  <%= content_tag :div, class: select_helper.css_classes do %>
19
19
  <% if is_page_heading %>
20
+ <% add_gem_component_stylesheet("title") %>
20
21
  <%= tag.h1 label_tag(id, label, class: select_helper.label_classes), class: "gem-c-title__text" %>
21
22
  <% else %>
22
23
  <%= label_tag(id, label, class: select_helper.label_classes) %>
@@ -26,7 +26,7 @@
26
26
  <% if ga4_tracking
27
27
  ga4_attributes = {
28
28
  event_name: "navigation",
29
- type: "related content",
29
+ type: "part of",
30
30
  index:{
31
31
  "index_link": "1"
32
32
  },
@@ -56,7 +56,7 @@
56
56
  <% if ga4_tracking
57
57
  ga4_attributes = {
58
58
  event_name: "navigation",
59
- type: "related content",
59
+ type: "part of",
60
60
  index:{
61
61
  "index_link": (index + 1).to_s
62
62
  },
@@ -1,3 +1,3 @@
1
- <svg class="gem-c-attachment__thumbnail-image" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
1
+ <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--document" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
2
2
  <path d="M12 12h75v27H12zM12 59h9v9h-9zM12 77h9v9h-9zM12 95h9v9h-9zM12 113h9v9h-9zM30 59h57v9H30zM30 77h39v9H30zM30 95h57v9H30zM30 113h48v9H30z" stroke-width="0"/>
3
3
  </svg>
@@ -1,4 +1,4 @@
1
- <svg class="gem-c-attachment__thumbnail-image" version="1.1" viewBox="0 0 84 120" width="84" height="120" aria-hidden="true">
1
+ <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--generic" version="1.1" viewBox="0 0 84 120" width="84" height="120" aria-hidden="true">
2
2
  <path d="M74.85 5v106H5" fill="none" stroke-miterlimit="10" stroke-width="2"/>
3
3
  <path d="M79.85 10v106H10" fill="none" stroke-miterlimit="10" stroke-width="2"/>
4
4
  </svg>
@@ -0,0 +1,3 @@
1
+ <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--html" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
2
+ <path d="M30,95h57v9H30V95z M30,77v9h39v-9H30z M30,122h48v-9H30V122z M12,68h9v-9h-9V68z M12,104h9v-9h-9V104z M12,86h9v-9h-9V86z M12,122h9v-9h-9V122z M87,12v27H12V12H87z M33,17h-4v8h-6v-8h-4v18h4v-7l6,0v7l4,0V17z M49,17H35l0,3h5v15h4V20l5,0V17z M68,17h-4 l-5,6l-5-6h-4v18h4l0-12l5,6l5-6l0,12h4V17z M81,32h-6V17h-4v18h10V32z M30,68h57v-9H30V68z" stroke-width="0"/>
3
+ </svg>
@@ -1,4 +1,4 @@
1
- <svg class="gem-c-attachment__thumbnail-image" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
1
+ <svg class="gem-c-attachment__thumbnail-image gem-c-attachment__thumbnail-image--spreadsheet" version="1.1" viewBox="0 0 99 140" width="99" height="140" aria-hidden="true">
2
2
  <path d="M12 12h75v27H12zm0 47h18.75v63H12zm55 2v59H51V61h16m2-2H49v63h20V59z" stroke-width="0"/>
3
3
  <path d="M49 61.05V120H32.8V61.05H49m2-2H30.75v63H51V59zm34 2V120H69.05V61.05H85m2-2H67v63h20V59z" stroke-width="0"/>
4
4
  <path d="M30 68.5h56.5M30 77.34h56.5M30 112.7h56.5M30 95.02h56.5M30 86.18h56.5M30 103.86h56.5" fill="none" stroke-miterlimit="10" stroke-width="2"/>
@@ -177,3 +177,24 @@ examples:
177
177
  content_type: application/pdf
178
178
  file_size: 20000
179
179
  thumbnail_url: "https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/791567/thumbnail_the_government_financial_reporting_review_web.pdf.png"
180
+ with_preview_link:
181
+ data:
182
+ attachment:
183
+ title: "Consular data: February 2018"
184
+ url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/687542/February_2018_Consular_MI.csv
185
+ filename: February_2018_Consular_MI.csv
186
+ content_type: text/csv
187
+ file_size: 51496
188
+ preview_url: https://assets.publishing.service.gov.uk/government/uploads/system/uploads/attachment_data/file/687542/February_2018_Consular_MI.csv/preview
189
+ html_attachment:
190
+ data:
191
+ attachment:
192
+ title: "Smart meters: unlocking the future"
193
+ url: https://www.gov.uk/government/publications/smart-meters-unlocking-the-future/smart-meters-unlocking-the-future
194
+ type: html
195
+ external_attachment:
196
+ data:
197
+ attachment:
198
+ title: "Architects Registration Board annual report 2021"
199
+ url: https://arb.org.uk/wp-content/uploads/ARB-Annual-Report-and-Financial-Statement-2021-published.pdf
200
+ type: external
@@ -37,6 +37,23 @@ examples:
37
37
  metadata:
38
38
  public_updated_at: 2016-09-05 16:48:27
39
39
  document_type: 'Statutory guidance'
40
+ with_margin:
41
+ description: The component accepts a number for margin bottom from `0` to `9` (`0px` to `60px`) using the [GOV.UK Frontend spacing scale](https://design-system.service.gov.uk/styles/spacing/#the-responsive-spacing-scale). It defaults to having a margin bottom of 5 (25px).
42
+ data:
43
+ margin_bottom: 9
44
+ items:
45
+ - link:
46
+ text: 'Alternative provision'
47
+ path: '/government/publications/alternative-provision'
48
+ metadata:
49
+ public_updated_at: 2016-06-27 10:29:44
50
+ document_type: 'Statutory guidance'
51
+ - link:
52
+ text: 'Behaviour and discipline in schools: guide for governing bodies'
53
+ path: '/government/publications/behaviour-and-discipline-in-schools-guidance-for-governing-bodies'
54
+ metadata:
55
+ public_updated_at: 2015-09-24 16:42:48
56
+ document_type: 'Statutory guidance'
40
57
  without_links:
41
58
  data:
42
59
  items:
@@ -27,6 +27,12 @@ examples:
27
27
  description: This allows the header to be omitted which is currently used when rendering CSV previews from Whitehall
28
28
  data:
29
29
  omit_header: true
30
+ blue_bar_background:
31
+ description: For use when a page has a heading component with a background colour.
32
+ data:
33
+ full_width: true
34
+ blue_bar: true
35
+ blue_bar_background_colour: "no"
30
36
  omit_feedback:
31
37
  description: This allows the feedback form to be omitted
32
38
  data:
@@ -1,3 +1,25 @@
1
+ <% content_for :body do %>
2
+ <% if @preview %>
3
+ <main id="wrapper" class="govuk-width-container">
4
+ <%= yield %>
5
+ </main>
6
+ <% else %>
7
+ <%= render "govuk_publishing_components/components/layout_header", {
8
+ environment: GovukPublishingComponents::AppHelpers::Environment.current_acceptance_environment,
9
+ product_name: GovukPublishingComponents::Config.component_guide_title,
10
+ href: component_guide_path
11
+ } %>
12
+ <div class="govuk-width-container app-width-container--wide">
13
+ <% if @guide_breadcrumbs %>
14
+ <%= render 'govuk_publishing_components/components/breadcrumbs', breadcrumbs: @guide_breadcrumbs %>
15
+ <% end %>
16
+ <main id="wrapper" class="govuk-main-wrapper">
17
+ <%= yield %>
18
+ </main>
19
+ </div>
20
+ <%= render "govuk_publishing_components/components/layout_footer" %>
21
+ <% end %>
22
+ <% end %>
1
23
  <!DOCTYPE html>
2
24
  <html lang="en" class="<%= "govuk-template" unless @preview %>">
3
25
  <head>
@@ -27,26 +49,7 @@
27
49
  <%= javascript_tag nonce: true do -%>
28
50
  document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
29
51
  <% end -%>
30
- <% if @preview %>
31
- <main id="wrapper" class="govuk-width-container">
32
- <%= yield %>
33
- </main>
34
- <% else %>
35
- <%= render "govuk_publishing_components/components/layout_header", {
36
- environment: GovukPublishingComponents::AppHelpers::Environment.current_acceptance_environment,
37
- product_name: GovukPublishingComponents::Config.component_guide_title,
38
- href: component_guide_path
39
- } %>
40
- <div class="govuk-width-container app-width-container--wide">
41
- <% if @guide_breadcrumbs %>
42
- <%= render 'govuk_publishing_components/components/breadcrumbs', breadcrumbs: @guide_breadcrumbs %>
43
- <% end %>
44
- <main id="wrapper" class="govuk-main-wrapper">
45
- <%= yield %>
46
- </main>
47
- </div>
48
- <%= render "govuk_publishing_components/components/layout_footer" %>
49
- <% end %>
52
+ <%= yield :body %>
50
53
 
51
54
  <%= javascript_include_tag "component_guide/application" %>
52
55
  <%= javascript_include_tag "#{GovukPublishingComponents::Config.application_javascript}" %>
@@ -23,6 +23,7 @@ ar:
23
23
  other: "%{count} صفحات"
24
24
  two:
25
25
  zero:
26
+ preview_link:
26
27
  reference: 'مرجع: %{reference}'
27
28
  request_format_cta: طلب تنسيق يمكن الاطلاع عليه.
28
29
  request_format_details_html: إذا كنت تستخدم تكنولوجيا مساعِدة (مثل قارئ للشاشة) وتحتاج إلى إصدار من هذا المستند بتنسيق يسهل الاطلاع عليه، فيُرجى التواصل عبر البريد الإلكتروني <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. من فضلك أخبرنا بالتنسيق الذي تحتاجه. إذا أخبرتنا بالتكنولوجيا المساعدة التي تستخدمها، فهذا سيساعدنا.
@@ -19,6 +19,7 @@ az:
19
19
  page:
20
20
  one:
21
21
  other: "%{count} səhifə"
22
+ preview_link:
22
23
  reference: 'İst: %{reference}'
23
24
  request_format_cta: İstifadə edilə bilən format tələb edin.
24
25
  request_format_details_html: Köməkçi texnologiyalardan (ekran oxuyucusu kimi) istifadə edirsinizsə və sizə bu sənədin daha rahat istifadə edilə bilən formatda olan versiyası lazımdırsa, aşağıdakı ünvana e-məktubla müraciət edin <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Sizə hansı formatın lazım olduğunu bizə söyləyin. Hansı köməkçi texnologiyadan istifadə etdiyinizi bildirməyiniz bizə kömək edəcək.
@@ -21,6 +21,7 @@ be:
21
21
  many:
22
22
  one: 1 старонка
23
23
  other: "%{count} старонкi"
24
+ preview_link:
24
25
  reference: 'Спасылка: %{reference}'
25
26
  request_format_cta: Запрасіць файл у іншым фармаце.
26
27
  request_format_details_html: Калі вы выкарыстоўваеце дапаможных тэхналогіi (такiя як экранны дыктар) i патрэбна версiя гэтага дакумента ў больш даступным фармаце, напішыце, калі ласка  на электронную пошту <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Калі ласка, паведаміце нам, які фармат вам патрэбен. Нам будзе лягчэй, калі вы паведаміце, якія дапаможныя тэхналогіi вы выкарыстоўваеце.