govuk_publishing_components 21.59.0 → 21.60.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +31 -6
  3. data/app/assets/javascripts/component_guide/accessibility-test.js +21 -21
  4. data/app/assets/javascripts/component_guide/filter-components.js +19 -19
  5. data/app/assets/javascripts/component_guide/visual-regression.js +38 -37
  6. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +2 -2
  7. data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +4 -4
  8. data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +31 -0
  9. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +24 -24
  10. data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +17 -17
  11. data/app/assets/stylesheets/component_guide/application.scss +15 -15
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +0 -8
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +4 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +1 -8
  16. data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +0 -1
  17. data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +4 -5
  18. data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +3 -8
  19. data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -1
  20. data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
  21. data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +5 -8
  22. data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +4 -0
  23. data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +2 -2
  24. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +0 -1
  25. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +0 -5
  26. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -4
  27. data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +8 -12
  28. data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +21 -24
  29. data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +4 -8
  30. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +2 -0
  31. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -4
  32. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +2 -4
  33. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +2 -0
  34. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +2 -0
  35. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -0
  36. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
  37. data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +2 -0
  38. data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -1
  39. data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +2 -0
  40. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss +0 -4
  41. data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -10
  42. data/app/controllers/govuk_publishing_components/audit_controller.rb +2 -2
  43. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +2 -2
  44. data/app/models/govuk_publishing_components/audit_applications.rb +19 -13
  45. data/app/models/govuk_publishing_components/audit_comparer.rb +64 -51
  46. data/app/models/govuk_publishing_components/audit_components.rb +25 -6
  47. data/app/views/govuk_publishing_components/audit/show.html.erb +198 -190
  48. data/app/views/govuk_publishing_components/component_guide/index.html.erb +3 -1
  49. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
  50. data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -1
  51. data/app/views/govuk_publishing_components/components/_radio.html.erb +13 -5
  52. data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +2 -2
  53. data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +4 -0
  54. data/app/views/govuk_publishing_components/components/docs/heading.yml +6 -3
  55. data/app/views/govuk_publishing_components/components/docs/radio.yml +4 -0
  56. data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +15 -7
  57. data/lib/govuk_publishing_components/presenters/heading_helper.rb +21 -1
  58. data/lib/govuk_publishing_components/version.rb +1 -1
  59. data/node_modules/axe-core/package.json +145 -220
  60. data/node_modules/govuk-frontend/package.json +14 -81
  61. data/node_modules/jquery/package.json +44 -116
  62. metadata +24 -66
  63. data/Rakefile +0 -37
@@ -3,6 +3,15 @@ module GovukPublishingComponents
3
3
  attr_reader :data
4
4
 
5
5
  def initialize(path)
6
+ @data = {
7
+ gem_found: false,
8
+ }
9
+ @data = compile_data(path) if Dir.exist?(path)
10
+ end
11
+
12
+ private
13
+
14
+ def compile_data(path)
6
15
  templates_path = "app/views/govuk_publishing_components/components"
7
16
  stylesheets_path = "app/assets/stylesheets/govuk_publishing_components/components"
8
17
  print_stylesheets_path = "app/assets/stylesheets/govuk_publishing_components/components/print"
@@ -10,7 +19,7 @@ module GovukPublishingComponents
10
19
  tests_path = "spec/components"
11
20
  js_tests_path = "spec/javascripts/components"
12
21
 
13
- templates = Dir["#{path}/#{templates_path}/*.html.erb"]
22
+ templates = Dir["#{path}/#{templates_path}/*.erb"]
14
23
  stylesheets = Dir["#{path}/#{stylesheets_path}/*.scss"]
15
24
  print_stylesheets = Dir["#{path}/#{print_stylesheets_path}/*.scss"]
16
25
  javascripts = Dir["#{path}/#{javascripts_path}/*.js"]
@@ -26,7 +35,8 @@ module GovukPublishingComponents
26
35
  @component_tests = find_files(tests, [path, tests_path].join("/"))
27
36
  @component_js_tests = find_files(js_tests, [path, js_tests_path].join("/"))
28
37
 
29
- @data = {
38
+ {
39
+ gem_found: true,
30
40
  component_code: @components,
31
41
  component_stylesheets: @component_stylesheets,
32
42
  component_print_stylesheets: @component_print_stylesheets,
@@ -38,18 +48,27 @@ module GovukPublishingComponents
38
48
  }
39
49
  end
40
50
 
41
- private
42
-
43
51
  def find_files(files, replace)
44
52
  files.map { |file| clean_file_name(file.gsub(replace, "")) }.sort
45
53
  end
46
54
 
47
55
  def clean_file_name(name)
48
- name.tr("/_-", " ").gsub(".html.erb", "").gsub(".scss", "").gsub(".js", "").gsub("spec", "").gsub(".rb", "").strip
56
+ name.tr("/_-", " ")
57
+ .gsub(".html.erb", "")
58
+ .gsub(".erb", "")
59
+ .gsub(".scss", "")
60
+ .gsub(".js", "")
61
+ .gsub("spec", "")
62
+ .gsub(".rb", "")
63
+ .strip
49
64
  end
50
65
 
51
66
  def get_component_name_from_full_path(path)
52
- path.gsub("/_", "/").gsub(@templates_full_path, "").gsub(".html.erb", "").tr('\"\'', "")
67
+ path.gsub("/_", "/")
68
+ .gsub(@templates_full_path, "")
69
+ .gsub(".html.erb", "")
70
+ .gsub(".erb", "")
71
+ .tr('\"\'', "")
53
72
  end
54
73
 
55
74
  def get_component_link(component)
@@ -2,220 +2,228 @@
2
2
 
3
3
  <%= render 'govuk_publishing_components/components/title', title: "Components audit", margin_top: 0; %>
4
4
 
5
- <div class="govuk-tabs" data-module="govuk-tabs">
6
- <h2 class="govuk-tabs__title">
7
- Contents
8
- </h2>
9
- <ul class="govuk-tabs__list">
10
- <li class="govuk-tabs__list-item govuk-tabs__list-item--selected">
11
- <a class="govuk-tabs__tab" href="#applications">
12
- Applications
13
- </a>
14
- </li>
15
- <li class="govuk-tabs__list-item">
16
- <a class="govuk-tabs__tab" href="#components-gem">
17
- Components
18
- </a>
19
- </li>
20
- </ul>
21
- <div class="govuk-tabs__panel" id="applications">
22
- <h2 class="govuk-heading-l">Applications</h2>
5
+ <% if ENV["MAIN_COMPONENT_GUIDE"] %>
6
+ <div class="govuk-tabs" data-module="govuk-tabs">
7
+ <h2 class="govuk-tabs__title">
8
+ Contents
9
+ </h2>
10
+ <ul class="govuk-tabs__list">
11
+ <li class="govuk-tabs__list-item govuk-tabs__list-item--selected">
12
+ <a class="govuk-tabs__tab" href="#applications">
13
+ Applications
14
+ </a>
15
+ </li>
16
+ <li class="govuk-tabs__list-item">
17
+ <a class="govuk-tabs__tab" href="#components-gem">
18
+ Components
19
+ </a>
20
+ </li>
21
+ </ul>
22
+ <div class="govuk-tabs__panel" id="applications">
23
+ <h2 class="govuk-heading-l">Applications</h2>
23
24
 
24
- <% if @applications.any? %>
25
- <details class="govuk-details" data-module="govuk-details">
26
- <summary class="govuk-details__summary">
27
- <span class="govuk-details__summary-text">
28
- How to use this information
29
- </span>
30
- </summary>
31
- <div class="govuk-details__text">
32
- <p class="govuk-body">This page shows information about component use on GOV.UK. This information has been cross referenced with the components in the gem to produce warnings where e.g. a print stylesheet for a component exists but has not been included in an application.</p>
33
- <p class="govuk-body">Warnings should be investigated, although there may be a reason why the application has been configured as it is. Note that 'code' can refer to templates or ruby code.</p>
25
+ <% if @applications.any? %>
26
+ <details class="govuk-details" data-module="govuk-details">
27
+ <summary class="govuk-details__summary">
28
+ <span class="govuk-details__summary-text">
29
+ How to use this information
30
+ </span>
31
+ </summary>
32
+ <div class="govuk-details__text">
33
+ <p class="govuk-body">This page shows information about component use on GOV.UK. This information has been cross referenced with the components in the gem to produce warnings where e.g. a print stylesheet for a component exists but has not been included in an application.</p>
34
+ <p class="govuk-body">Warnings should be investigated, although there may be a reason why the application has been configured as it is. Note that 'code' can refer to templates or ruby code.</p>
35
+ </div>
36
+ </details>
37
+
38
+ <div class="govuk-accordion" data-module="govuk-accordion" id="accordion-with-summary-sections">
39
+ <% @applications.each_with_index do |application, index| %>
40
+ <div class="govuk-accordion__section ">
41
+ <div class="govuk-accordion__section-header">
42
+ <h2 class="govuk-accordion__section-heading">
43
+ <span class="govuk-accordion__section-button" id="accordion-with-summary-sections-heading-<%= index %>">
44
+ <%= application[:name] %>
45
+ </span>
46
+ </h2>
47
+ <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-<%= index %>">
48
+ <% if application[:application_found] %>
49
+ Warnings:
50
+ <% if application[:warning_count] > 0 %>
51
+ <strong class="govuk-tag govuk-tag--red"><%= application[:warning_count] %></strong>
52
+ <% else %>
53
+ <%= application[:warning_count] %>
54
+ <% end %>
55
+ <% else %>
56
+ <strong class="govuk-tag govuk-tag--red">Application not found</strong>
57
+ <% end %>
58
+ </div>
59
+ </div>
60
+ <div id="accordion-with-summary-sections-content-<%= index %>" class="govuk-accordion__section-content" aria-labelledby="accordion-with-summary-sections-heading-<%= index %>">
61
+ <% if application[:application_found] %>
62
+ <% application[:warnings].each do |warning| %>
63
+ <p class="govuk-body">
64
+ <strong class="govuk-tag">Warn</strong>
65
+ <strong><%= warning[:component] %></strong> - <%= warning[:message] %>
66
+ </p>
67
+ <% end %>
68
+
69
+ <h3 class="govuk-heading-m">Components used</h3>
70
+
71
+ <dl class="govuk-summary-list">
72
+ <% application[:summary].each do |item| %>
73
+ <div class="govuk-summary-list__row">
74
+ <dt class="govuk-summary-list__key">
75
+ <%= item[:name] %>
76
+ </dt>
77
+ <dd class="govuk-summary-list__value">
78
+ <% if item[:value].length > 0 %>
79
+ <%= item[:value] %>
80
+ <% else %>
81
+ None
82
+ <% end %>
83
+ </dd>
84
+ </div>
85
+ <% end %>
86
+ </dl>
87
+ <% else %>
88
+ <p class="govuk-body">This application was not found. This could be because you do not have this repository checked out locally.</p>
89
+ <% end %>
90
+ </div>
91
+ </div>
92
+ <% end %>
34
93
  </div>
35
- </details>
94
+ <% else %>
95
+ <p class="govuk-body">No applications found.</p>
96
+ <% end %>
97
+ </div>
36
98
 
37
- <div class="govuk-accordion" data-module="govuk-accordion" id="accordion-with-summary-sections">
38
- <% @applications.each_with_index do |application, index| %>
99
+ <div class="govuk-tabs__panel govuk-tabs__panel--hidden" id="components-gem">
100
+ <h2 class="govuk-heading-l">Components</h2>
101
+
102
+ <% if @components.any? %>
103
+ <div class="govuk-accordion" data-module="govuk-accordion" id="accordion-default">
39
104
  <div class="govuk-accordion__section ">
40
105
  <div class="govuk-accordion__section-header">
41
106
  <h2 class="govuk-accordion__section-heading">
42
- <span class="govuk-accordion__section-button" id="accordion-with-summary-sections-heading-<%= index %>">
43
- <%= application[:name] %>
107
+ <span class="govuk-accordion__section-button" id="accordion-default-heading-1">
108
+ Component files
44
109
  </span>
45
110
  </h2>
46
- <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-<%= index %>">
47
- <% if application[:application_found] %>
48
- Warnings:
49
- <% if application[:warning_count] > 0 %>
50
- <strong class="govuk-tag govuk-tag--red"><%= application[:warning_count] %></strong>
51
- <% else %>
52
- <%= application[:warning_count] %>
111
+ <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-1">
112
+ Lists what files each component has
113
+ </div>
114
+ </div>
115
+ <div id="accordion-default-content-1" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-1">
116
+ <table class="govuk-table">
117
+ <thead class="govuk-table__head">
118
+ <tr class="govuk-table__row">
119
+ <th scope="col" class="govuk-table__header sticky-table-header">Component</th>
120
+ <th scope="col" class="govuk-table__header sticky-table-header">Stylesheet</th>
121
+ <th scope="col" class="govuk-table__header sticky-table-header">Print stylesheet</th>
122
+ <th scope="col" class="govuk-table__header sticky-table-header">JS</th>
123
+ <th scope="col" class="govuk-table__header sticky-table-header">Test</th>
124
+ <th scope="col" class="govuk-table__header sticky-table-header">JS test</th>
125
+ </tr>
126
+ </thead>
127
+ <tbody class="govuk-table__body">
128
+ <% @components[:component_listing].each do |component| %>
129
+ <tr class="govuk-table__row">
130
+ <th scope="row" class="govuk-table__header">
131
+ <a href="<%= component[:link] %>" class="govuk-link"><%= component[:name] %></a>
132
+ </th>
133
+ <td class="govuk-table__cell">
134
+ <% if component[:stylesheet] %>
135
+ <strong class="govuk-tag govuk-tag--green">Yes</strong>
136
+ <% end %>
137
+ </td>
138
+ <td class="govuk-table__cell">
139
+ <% if component[:print_stylesheet] %>
140
+ <strong class="govuk-tag govuk-tag--green">Yes</strong>
141
+ <% end %>
142
+ </td>
143
+ <td class="govuk-table__cell">
144
+ <% if component[:javascript] %>
145
+ <strong class="govuk-tag govuk-tag--green">Yes</strong>
146
+ <% end %>
147
+ </td>
148
+ <td class="govuk-table__cell">
149
+ <% if component[:tests] %>
150
+ <strong class="govuk-tag govuk-tag--green">Yes</strong>
151
+ <% end %>
152
+ </td>
153
+ <td class="govuk-table__cell">
154
+ <% if component[:js_tests] %>
155
+ <strong class="govuk-tag govuk-tag--green">Yes</strong>
156
+ <% end %>
157
+ </td>
158
+ </tr>
53
159
  <% end %>
54
- <% else %>
55
- <strong class="govuk-tag govuk-tag--red">Application not found</strong>
56
- <% end %>
160
+ </tbody>
161
+ </table>
162
+ </div>
163
+ </div>
164
+
165
+ <div class="govuk-accordion__section ">
166
+ <div class="govuk-accordion__section-header">
167
+ <h2 class="govuk-accordion__section-heading">
168
+ <span class="govuk-accordion__section-button" id="accordion-default-heading-2">
169
+ Components containing components
170
+ </span>
171
+ </h2>
172
+ <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
173
+ Shows which components contain other components
57
174
  </div>
58
175
  </div>
59
- <div id="accordion-with-summary-sections-content-<%= index %>" class="govuk-accordion__section-content" aria-labelledby="accordion-with-summary-sections-heading-<%= index %>">
60
- <% if application[:application_found] %>
61
- <% application[:warnings].each do |warning| %>
62
- <p class="govuk-body">
63
- <strong class="govuk-tag">Warn</strong>
64
- <strong><%= warning[:component] %></strong> - <%= warning[:message] %>
65
- </p>
176
+ <div id="accordion-default-content-2" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-2">
177
+ <dl class="govuk-summary-list">
178
+ <% @components[:components_containing_components].each do |component| %>
179
+ <div class="govuk-summary-list__row">
180
+ <dt class="govuk-summary-list__key">
181
+ <a href="<%= component[:link] %>" class="govuk-link"><%= component[:component] %></a>
182
+ </dt>
183
+ <dd class="govuk-summary-list__value">
184
+ <%= component[:sub_components].join(', ') %>
185
+ </dd>
186
+ </div>
66
187
  <% end %>
67
-
68
- <h3 class="govuk-heading-m">Components used</h3>
69
-
188
+ </dl>
189
+ </div>
190
+ </div>
191
+ <div class="govuk-accordion__section ">
192
+ <div class="govuk-accordion__section-header">
193
+ <h2 class="govuk-accordion__section-heading">
194
+ <span class="govuk-accordion__section-button" id="accordion-default-heading-2">
195
+ Components by application
196
+ </span>
197
+ </h2>
198
+ <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
199
+ Shows which applications use each component
200
+ </div>
201
+ </div>
202
+ <div id="accordion-default-content-2" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-2">
203
+ <% if @components[:components_by_application].any? %>
70
204
  <dl class="govuk-summary-list">
71
- <% application[:summary].each do |item| %>
205
+ <% @components[:components_by_application].each do |component| %>
72
206
  <div class="govuk-summary-list__row">
73
207
  <dt class="govuk-summary-list__key">
74
- <%= item[:name] %>
208
+ <%= component[:component] %> (<%= component[:count] %>)
75
209
  </dt>
76
210
  <dd class="govuk-summary-list__value">
77
- <% if item[:value].length > 0 %>
78
- <%= item[:value] %>
79
- <% else %>
80
- None
81
- <% end %>
211
+ <%= component[:list] %>
82
212
  </dd>
83
213
  </div>
84
214
  <% end %>
85
215
  </dl>
86
216
  <% else %>
87
- <p class="govuk-body">This application was not found. This could be because you do not have this repository checked out locally.</p>
217
+ <p class="govuk-body">Sorry, no applications found.</p>
88
218
  <% end %>
89
219
  </div>
90
220
  </div>
91
- <% end %>
92
- </div>
93
- <% else %>
94
- <p class="govuk-body">No applications found.</p>
95
- <% end %>
96
- </div>
97
-
98
- <div class="govuk-tabs__panel govuk-tabs__panel--hidden" id="components-gem">
99
- <h2 class="govuk-heading-l">Components</h2>
100
-
101
- <% if @components.any? %>
102
- <div class="govuk-accordion" data-module="govuk-accordion" id="accordion-default">
103
- <div class="govuk-accordion__section ">
104
- <div class="govuk-accordion__section-header">
105
- <h2 class="govuk-accordion__section-heading">
106
- <span class="govuk-accordion__section-button" id="accordion-default-heading-1">
107
- Component files
108
- </span>
109
- </h2>
110
- <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-1">
111
- Lists what files each component has
112
- </div>
113
- </div>
114
- <div id="accordion-default-content-1" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-1">
115
- <table class="govuk-table">
116
- <thead class="govuk-table__head">
117
- <tr class="govuk-table__row">
118
- <th scope="col" class="govuk-table__header">Component</th>
119
- <th scope="col" class="govuk-table__header">Stylesheet</th>
120
- <th scope="col" class="govuk-table__header">Print stylesheet</th>
121
- <th scope="col" class="govuk-table__header">JS</th>
122
- <th scope="col" class="govuk-table__header">Test</th>
123
- <th scope="col" class="govuk-table__header">JS test</th>
124
- </tr>
125
- </thead>
126
- <tbody class="govuk-table__body">
127
- <% @components[:component_listing].each do |component| %>
128
- <tr class="govuk-table__row">
129
- <th scope="row" class="govuk-table__header">
130
- <a href="<%= component[:link] %>" class="govuk-link"><%= component[:name] %></a>
131
- </th>
132
- <td class="govuk-table__cell">
133
- <% if component[:stylesheet] %>
134
- <strong class="govuk-tag govuk-tag--green">Yes</strong>
135
- <% end %>
136
- </td>
137
- <td class="govuk-table__cell">
138
- <% if component[:print_stylesheet] %>
139
- <strong class="govuk-tag govuk-tag--green">Yes</strong>
140
- <% end %>
141
- </td>
142
- <td class="govuk-table__cell">
143
- <% if component[:javascript] %>
144
- <strong class="govuk-tag govuk-tag--green">Yes</strong>
145
- <% end %>
146
- </td>
147
- <td class="govuk-table__cell">
148
- <% if component[:tests] %>
149
- <strong class="govuk-tag govuk-tag--green">Yes</strong>
150
- <% end %>
151
- </td>
152
- <td class="govuk-table__cell">
153
- <% if component[:js_tests] %>
154
- <strong class="govuk-tag govuk-tag--green">Yes</strong>
155
- <% end %>
156
- </td>
157
- </tr>
158
- <% end %>
159
- </tbody>
160
- </table>
161
- </div>
162
- </div>
163
-
164
- <div class="govuk-accordion__section ">
165
- <div class="govuk-accordion__section-header">
166
- <h2 class="govuk-accordion__section-heading">
167
- <span class="govuk-accordion__section-button" id="accordion-default-heading-2">
168
- Components containing components
169
- </span>
170
- </h2>
171
- <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
172
- Shows which components contain other components
173
- </div>
174
- </div>
175
- <div id="accordion-default-content-2" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-2">
176
- <dl class="govuk-summary-list">
177
- <% @components[:components_containing_components].each do |component| %>
178
- <div class="govuk-summary-list__row">
179
- <dt class="govuk-summary-list__key">
180
- <a href="<%= component[:link] %>" class="govuk-link"><%= component[:component] %></a>
181
- </dt>
182
- <dd class="govuk-summary-list__value">
183
- <%= component[:sub_components].join(', ') %>
184
- </dd>
185
- </div>
186
- <% end %>
187
- </dl>
188
- </div>
189
- </div>
190
- <div class="govuk-accordion__section ">
191
- <div class="govuk-accordion__section-header">
192
- <h2 class="govuk-accordion__section-heading">
193
- <span class="govuk-accordion__section-button" id="accordion-default-heading-2">
194
- Components by application
195
- </span>
196
- </h2>
197
- <div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
198
- Shows which applications use each component
199
- </div>
200
- </div>
201
- <div id="accordion-default-content-2" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-2">
202
- <dl class="govuk-summary-list">
203
- <% @components[:components_by_application].each do |component| %>
204
- <div class="govuk-summary-list__row">
205
- <dt class="govuk-summary-list__key">
206
- <%= component[:component] %> (<%= component[:count] %>)
207
- </dt>
208
- <dd class="govuk-summary-list__value">
209
- <%= component[:list] %>
210
- </dd>
211
- </div>
212
- <% end %>
213
- </dl>
214
- </div>
215
221
  </div>
216
- </div>
217
- <% else %>
218
- <p class="govuk-body">No components found.</p>
219
- <% end %>
222
+ <% else %>
223
+ <p class="govuk-body">No components found.</p>
224
+ <% end %>
225
+ </div>
220
226
  </div>
221
- </div>
227
+ <% else %>
228
+ <p class="govuk-body">Component auditing is only available when the component guide is running locally as a standalone app.</p>
229
+ <% end %>