govuk_publishing_components 35.6.0 → 35.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (90) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/component_guide/audit-filter.js +45 -0
  3. data/app/assets/stylesheets/component_guide/application.scss +0 -25
  4. data/app/views/govuk_publishing_components/audit/_component_contents.html.erb +37 -49
  5. data/app/views/govuk_publishing_components/components/_attachment.html.erb +38 -18
  6. data/app/views/govuk_publishing_components/components/_character_count.html.erb +4 -2
  7. data/app/views/govuk_publishing_components/components/_feedback.html.erb +1 -0
  8. data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +1 -0
  9. data/app/views/govuk_publishing_components/components/_radio.html.erb +1 -0
  10. data/app/views/govuk_publishing_components/components/_search.html.erb +1 -0
  11. data/app/views/govuk_publishing_components/components/_select.html.erb +1 -0
  12. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_document.html.erb +1 -1
  13. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_generic.html.erb +1 -1
  14. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_html.html.erb +3 -0
  15. data/app/views/govuk_publishing_components/components/attachment/_thumbnail_spreadsheet.html.erb +1 -1
  16. data/app/views/govuk_publishing_components/components/docs/attachment.yml +21 -0
  17. data/app/views/layouts/govuk_publishing_components/application.html.erb +23 -20
  18. data/config/locales/ar.yml +1 -0
  19. data/config/locales/az.yml +1 -0
  20. data/config/locales/be.yml +1 -0
  21. data/config/locales/bg.yml +1 -0
  22. data/config/locales/bn.yml +1 -0
  23. data/config/locales/cs.yml +1 -0
  24. data/config/locales/cy.yml +1 -0
  25. data/config/locales/da.yml +1 -0
  26. data/config/locales/de.yml +1 -0
  27. data/config/locales/dr.yml +1 -0
  28. data/config/locales/el.yml +1 -0
  29. data/config/locales/en.yml +1 -0
  30. data/config/locales/es-419.yml +1 -0
  31. data/config/locales/es.yml +1 -0
  32. data/config/locales/et.yml +1 -0
  33. data/config/locales/fa.yml +1 -0
  34. data/config/locales/fi.yml +1 -0
  35. data/config/locales/fr.yml +1 -0
  36. data/config/locales/gd.yml +1 -0
  37. data/config/locales/gu.yml +1 -0
  38. data/config/locales/he.yml +1 -0
  39. data/config/locales/hi.yml +1 -0
  40. data/config/locales/hr.yml +1 -0
  41. data/config/locales/hu.yml +1 -0
  42. data/config/locales/hy.yml +1 -0
  43. data/config/locales/id.yml +1 -0
  44. data/config/locales/is.yml +1 -0
  45. data/config/locales/it.yml +1 -0
  46. data/config/locales/ja.yml +1 -0
  47. data/config/locales/ka.yml +1 -0
  48. data/config/locales/kk.yml +1 -0
  49. data/config/locales/ko.yml +1 -0
  50. data/config/locales/lt.yml +1 -0
  51. data/config/locales/lv.yml +1 -0
  52. data/config/locales/ms.yml +1 -0
  53. data/config/locales/mt.yml +1 -0
  54. data/config/locales/nl.yml +1 -0
  55. data/config/locales/no.yml +1 -0
  56. data/config/locales/pa-pk.yml +1 -0
  57. data/config/locales/pa.yml +1 -0
  58. data/config/locales/pl.yml +1 -0
  59. data/config/locales/ps.yml +1 -0
  60. data/config/locales/pt.yml +1 -0
  61. data/config/locales/ro.yml +1 -0
  62. data/config/locales/ru.yml +1 -0
  63. data/config/locales/si.yml +1 -0
  64. data/config/locales/sk.yml +1 -0
  65. data/config/locales/sl.yml +1 -0
  66. data/config/locales/so.yml +1 -0
  67. data/config/locales/sq.yml +1 -0
  68. data/config/locales/sr.yml +1 -0
  69. data/config/locales/sv.yml +1 -0
  70. data/config/locales/sw.yml +1 -0
  71. data/config/locales/ta.yml +1 -0
  72. data/config/locales/th.yml +1 -0
  73. data/config/locales/tk.yml +1 -0
  74. data/config/locales/tr.yml +1 -0
  75. data/config/locales/uk.yml +1 -0
  76. data/config/locales/ur.yml +1 -0
  77. data/config/locales/uz.yml +1 -0
  78. data/config/locales/vi.yml +1 -0
  79. data/config/locales/zh-hk.yml +1 -0
  80. data/config/locales/zh-tw.yml +1 -0
  81. data/config/locales/zh.yml +1 -0
  82. data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +5 -1
  83. data/lib/govuk_publishing_components/presenters/attachment_helper.rb +15 -3
  84. data/lib/govuk_publishing_components/version.rb +1 -1
  85. data/node_modules/axe-core/README.md +4 -0
  86. data/node_modules/axe-core/axe.js +25 -19
  87. data/node_modules/axe-core/axe.min.js +2 -2
  88. data/node_modules/axe-core/package.json +1 -1
  89. data/node_modules/axe-core/sri-history.json +4 -0
  90. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61fa79cdba028670638393c805fd3cb9ebff6ea2d03f4b4fdff7e973e1b86aae
4
- data.tar.gz: 2c82ee33f9cfaf8e920777530ad7da376b113fca3b02f741eb993712fac4a4aa
3
+ metadata.gz: 19aaa8a186568f17fc86baced60aab3d35f790e35f819702736f6dc861f64bcb
4
+ data.tar.gz: 947c684323444fb20d04063a801f71868193ca46ee7dfba877a26b05c235ae5f
5
5
  SHA512:
6
- metadata.gz: 0d766ce3ff5f8236b098a2ce61b6c0ccdd4039393168bf25c0128919563f8113792da9adcef6e0edbec2af19382f4db18f405edb402fa2598c2df49ff4288335
7
- data.tar.gz: 6c13cdf892754b1b55834d950e3dad1aeceb138cdb76e509b785d381721e78747db2c51070859829d9d8e348a0f2fa4fe7beb4498f55a761a397d0659206a94a
6
+ metadata.gz: 4c151b005305fa534de28d3769131a41334c3a39b64e89a8f737f6e59747ba03d28d24e62fcdf122fb9b290c5a3d3596842aa973100a208144c83280dcf12fb1
7
+ data.tar.gz: 1ef830fa00101728968b9bc2e0d865f923cf00cbd265b33d5e8958f18539938146a1b802e6e6d42a0ee269fc2be3664ba89734d67dbcabef04187a46caa22df8
@@ -5,6 +5,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
5
5
  function AuditFilter ($module) {
6
6
  this.module = $module
7
7
  this.data = this.module.querySelector('[data-audit-list]')
8
+ this.headings = this.module.querySelector('[data-audit-headings]')
8
9
  }
9
10
 
10
11
  AuditFilter.prototype.init = function () {
@@ -14,6 +15,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
14
15
 
15
16
  this.filterComponentsFunction = this.filterComponents.bind(this)
16
17
  this.select.addEventListener('change', this.filterComponentsFunction)
18
+ this.setHeadingCount()
17
19
  }
18
20
  }
19
21
 
@@ -75,6 +77,49 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
75
77
  }
76
78
  }
77
79
  }
80
+ this.setHeadingCount()
81
+ }
82
+
83
+ AuditFilter.prototype.setHeadingCount = function () {
84
+ if (this.headings) {
85
+ var visibleRows = this.data.querySelectorAll('[data-application]:not([hidden])')
86
+
87
+ if (!this.headingLabels) {
88
+ this.headingLabels = this.getHeadingLabels()
89
+ }
90
+ // need an array of zeroes same length as headingLabels to store the counts
91
+ var headingCounts = new Array(this.headingLabels.length)
92
+ for (var i = 0; i < this.headingLabels.length; ++i) {
93
+ headingCounts[i] = 0
94
+ }
95
+
96
+ for (var j = 0; j < visibleRows.length; j++) {
97
+ for (var k = 0; k < this.headingLabels.length; k++) {
98
+ var cell = visibleRows[j].querySelector('[data-component-type=' + this.headingLabels[k] + ']')
99
+ if (cell.textContent.trim().length) {
100
+ headingCounts[k] += 1
101
+ }
102
+ }
103
+ }
104
+
105
+ var reg = /\([0-9]+\)/i
106
+ for (var l = 0; l < this.headingLabels.length; l++) {
107
+ var headingItem = this.headings.querySelector('[data-component-type=' + this.headingLabels[l] + ']')
108
+ headingItem.textContent = headingItem.textContent.replace(reg, '') + ' (' + headingCounts[l] + ')'
109
+ }
110
+ }
111
+ }
112
+
113
+ AuditFilter.prototype.getHeadingLabels = function () {
114
+ var headings = this.headings.querySelectorAll('[data-component-type]')
115
+ var labels = []
116
+ for (var i = 0; i < headings.length; i++) {
117
+ var label = headings[i].getAttribute('data-component-type')
118
+ if (labels.indexOf(label) === -1) {
119
+ labels.push(label)
120
+ }
121
+ }
122
+ return labels
78
123
  }
79
124
 
80
125
  Modules.AuditFilter = AuditFilter
@@ -6,31 +6,6 @@ $govuk-new-link-styles: true;
6
6
  @import "govuk_publishing_components/govuk_frontend_support";
7
7
  @import "govuk_publishing_components/component_support";
8
8
 
9
- // Import the same stylesheets used in static
10
- // https://github.com/alphagov/static/blob/198a598682df40ce4a2c3c286c06244297c18cf0/app/assets/stylesheets/application.scss
11
- // Although the component guide does not use static, we still need to import the same stylesheets used in static
12
- // to avoid any rendering issues
13
- // By following the same approach as frontend rendering applications,
14
- // we ensure that stylesheets are loaded in the expected order and components render correctly
15
- @import "govuk_publishing_components/components/breadcrumbs";
16
- @import "govuk_publishing_components/components/button";
17
- @import "govuk_publishing_components/components/error-message";
18
- @import "govuk_publishing_components/components/heading";
19
- @import "govuk_publishing_components/components/hint";
20
- @import "govuk_publishing_components/components/input";
21
- @import "govuk_publishing_components/components/label";
22
- @import "govuk_publishing_components/components/search";
23
- @import "govuk_publishing_components/components/skip-link";
24
- @import "govuk_publishing_components/components/textarea";
25
- @import "govuk_publishing_components/components/title";
26
-
27
- @import "govuk_publishing_components/components/cookie-banner";
28
- @import "govuk_publishing_components/components/feedback";
29
- @import "govuk_publishing_components/components/layout-footer";
30
- @import "govuk_publishing_components/components/layout-for-public";
31
- @import "govuk_publishing_components/components/layout-header";
32
- @import "govuk_publishing_components/components/layout-super-navigation-header";
33
-
34
9
  // Include required helpers
35
10
  @import "../../stylesheets/govuk_publishing_components/components/helpers/markdown-typography";
36
11
 
@@ -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>
@@ -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,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)
@@ -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/"
@@ -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) %>
@@ -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
@@ -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 вы выкарыстоўваеце.
@@ -19,6 +19,7 @@ bg:
19
19
  page:
20
20
  one: 1-ва страница
21
21
  other: "%{count} страници"
22
+ preview_link:
22
23
  reference: 'Реф: %{reference}'
23
24
  request_format_cta: Поискайте достъпен формат.
24
25
  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 @@ bn:
19
19
  page:
20
20
  one: 1 পেজ
21
21
  other: "%{count} পেজ"
22
+ preview_link:
22
23
  reference: 'সুত্র: %{reference}'
23
24
  request_format_cta: একটি প্রবেশযোগ্য ফরম্যাটের অনুরোধ করুন।
24
25
  request_format_details_html: আপনি যদি সহায়তামূলক প্রযুক্তি (যেমন স্ক্রিন রিডার) ব্যবহার করেন এবং এই নথির একটি সংস্করণ আরও ভালোভাবে ব্যবহার করার ফরম্যাটে প্রয়োজন হয়, তবে অনুগ্রহ করে <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>-এ ইমেইল করুন। আপনার কোন ফরম্যাট প্রয়োজন অনুগ্রহ করে তা আমাদেরকে জানান। আপনি কোন সহায়তামূলক প্রযুক্তি ব্যবহার করেন তা জানালে আমাদের জন্য সহায়ক হবে।
@@ -20,6 +20,7 @@ cs:
20
20
  few:
21
21
  one: Strana 1
22
22
  other: "%{count} stránek"
23
+ preview_link:
23
24
  reference: 'Odkaz: %{reference}'
24
25
  request_format_cta: Vyžádejte si přístupný formát.
25
26
  request_format_details_html: Pokud používáte asistivní technologii (např. čtečku obrazovky) a potřebujete verzi tohoto dokumentu v přístupnějším formátu, napište prosím <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Sdělte nám, jaký formát potřebujete. Pomůže nám, když uvedete, jakou asistenční technologii používáte.
@@ -23,6 +23,7 @@ cy:
23
23
  other: "%{count} o dudalennau"
24
24
  two:
25
25
  zero:
26
+ preview_link:
26
27
  reference: 'Cyfeirnod: %{reference}'
27
28
  request_format_cta: Gwneud cais am fformat hygyrch.
28
29
  request_format_details_html: Os ydych chi'n defnyddio technoleg gynorthwyol (er enghraifft, rhaglen darllen sgrin) a bod angen fersiwn o'r ddogfen hon arnoch mewn fformat mwy hygyrch, e-bostiwch <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Rhowch wybod i ni pa fformat sydd ei angen arnoch. Bydd yn ein helpu ni os byddwch chi'n dweud pa dechnoleg gynorthwyol rydych chi'n ei defnyddio.
@@ -19,6 +19,7 @@ da:
19
19
  page:
20
20
  one: 1 side
21
21
  other: "%{count} sider"
22
+ preview_link:
22
23
  reference: 'Henvisning: %{reference}'
23
24
  request_format_cta: Anmod om et tilgængeligt format.
24
25
  request_format_details_html: Hvis du bruger hjælpemidler (f.eks. en skærmlæser) og har brug for en version af dette dokument i et mere tilgængeligt format, bedes du sende en e-mail til <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Venligst fortæl os, hvilket format du har brug for. Det vil hjælpe os, hvis du fortæller os, hvilken hjælpeteknologi du bruger.
@@ -19,6 +19,7 @@ de:
19
19
  page:
20
20
  one: 1 Seite
21
21
  other: "%{count} Seiten"
22
+ preview_link:
22
23
  reference: 'Ref: %{reference}'
23
24
  request_format_cta: Fordern Sie ein zugängliches Format an.
24
25
  request_format_details_html: Sollten Sie Hilfsmittel (wie z. B. einen Bildschirmleser) verwenden und eine Version dieses Dokuments in einem leichter zugänglichen Format benötigen, senden Sie bitte eine Email an <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Bitte teilen Sie uns mit, welches Format Sie benötigen. Es erleichtert uns die Arbeit, wenn Sie uns mitteilen, welche Hilfsmittel Sie verwenden.
@@ -19,6 +19,7 @@ dr:
19
19
  page:
20
20
  one: صفحهء 1
21
21
  other: "%{count} صفحات"
22
+ preview_link:
22
23
  reference: "%{reference}:مرجع"
23
24
  request_format_cta: یک فارمت قابل دسترس را درخواست کنید.
24
25
  request_format_details_html: |-
@@ -19,6 +19,7 @@ el:
19
19
  page:
20
20
  one: 1 σελίδα
21
21
  other: "%{count} σελίδες"
22
+ preview_link:
22
23
  reference: 'Αναφ.: %{reference}'
23
24
  request_format_cta: Ζητήστε μια προσβάσιμη μορφή.
24
25
  request_format_details_html: Εάν χρησιμοποιείτε βοηθητική τεχνολογία (όπως ένα πρόγραμμα ανάγνωσης οθόνης) και χρειάζεστε μια έκδοση αυτού του εγγράφου σε πιο προσβάσιμη μορφή, στείλτε email στην διεύθυνση <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Πείτε μας τι μορφή χρειάζεστε. Θα μας βοηθήσει αν πείτε ποια βοηθητική τεχνολογία χρησιμοποιείτε.
@@ -16,6 +16,7 @@ en:
16
16
  attachment:
17
17
  opendocument_html: This file is in an <a href='https://www.gov.uk/guidance/using-open-document-formats-odf-in-your-organisation' target=%{target} class='govuk-link'>OpenDocument</a> format
18
18
  order_a_copy: Order a copy
19
+ preview_link: View online
19
20
  page:
20
21
  one: 1 page
21
22
  other: "%{count} pages"
@@ -19,6 +19,7 @@ es-419:
19
19
  page:
20
20
  one: 1 página
21
21
  other: "%{count} páginas"
22
+ preview_link:
22
23
  reference: 'Referencia: %{reference}'
23
24
  request_format_cta: Solicite un formato accesible.
24
25
  request_format_details_html: Si utiliza una tecnología de asistencia (como un lector de pantalla) y necesita una versión de este documento en un formato más accesible, envíe un correo electrónico a <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Por favor, indíquenos qué formato necesita. Nos ayudaría que nos dijeras qué tecnología de asistencia utilizas.
@@ -19,6 +19,7 @@ es:
19
19
  page:
20
20
  one: 1 página
21
21
  other: "%{count} páginas"
22
+ preview_link:
22
23
  reference: 'Ref.: %{reference}'
23
24
  request_format_cta: Solicitar un formato accesible.
24
25
  request_format_details_html: Si utiliza tecnología de asistencia (como un lector de pantalla) y necesita una versión de este documento en un formato más accesible, envíe un correo electrónico a <a href='mailto:%{alternative_format_contact_email}' target='_blank' class='govuk-link'>%{alternative_format_contact_email}</a>. Díganos qué formato necesita. Nos ayudará si usted dice qué tecnología de asistencia utiliza.