govuk_publishing_components 24.5.0 → 24.8.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (97) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/component_guide/application.js +3 -0
  3. data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +7 -5
  4. data/app/assets/javascripts/govuk_publishing_components/components/details.js +2 -1
  5. data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +1 -0
  6. data/app/assets/javascripts/govuk_publishing_components/modules.js +3 -1
  7. data/app/assets/stylesheets/component_guide/application.scss +1 -1
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +10 -1
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +8 -7
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +15 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_summary-list.scss +12 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +0 -5
  13. data/app/controllers/govuk_publishing_components/audit_controller.rb +21 -17
  14. data/app/controllers/govuk_publishing_components/component_guide_controller.rb +9 -0
  15. data/app/helpers/govuk_publishing_components/application_helper.rb +3 -0
  16. data/app/models/govuk_publishing_components/audit_applications.rb +3 -3
  17. data/app/models/govuk_publishing_components/audit_comparer.rb +16 -8
  18. data/app/models/govuk_publishing_components/audit_components.rb +6 -3
  19. data/app/views/govuk_publishing_components/audit/_applications.html.erb +126 -0
  20. data/app/views/govuk_publishing_components/audit/_components.html.erb +142 -0
  21. data/app/views/govuk_publishing_components/audit/show.html.erb +22 -277
  22. data/app/views/govuk_publishing_components/component_guide/index.html.erb +16 -0
  23. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +7 -2
  24. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +48 -7
  25. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +15 -12
  26. data/app/views/govuk_publishing_components/components/_summary_list.html.erb +18 -13
  27. data/app/views/govuk_publishing_components/components/_title.html.erb +6 -2
  28. data/app/views/govuk_publishing_components/components/docs/button.yml +7 -6
  29. data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +3 -0
  30. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +26 -0
  31. data/app/views/govuk_publishing_components/components/docs/summary_list.yml +50 -19
  32. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +8 -1
  33. data/config/locales/ar.yml +1 -0
  34. data/config/locales/az.yml +1 -0
  35. data/config/locales/be.yml +1 -0
  36. data/config/locales/bg.yml +1 -0
  37. data/config/locales/bn.yml +1 -0
  38. data/config/locales/cs.yml +1 -0
  39. data/config/locales/da.yml +1 -0
  40. data/config/locales/de.yml +1 -0
  41. data/config/locales/dr.yml +1 -0
  42. data/config/locales/el.yml +1 -0
  43. data/config/locales/es-419.yml +1 -0
  44. data/config/locales/es.yml +1 -0
  45. data/config/locales/fa.yml +1 -0
  46. data/config/locales/fi.yml +1 -0
  47. data/config/locales/gd.yml +1 -0
  48. data/config/locales/gu.yml +1 -0
  49. data/config/locales/he.yml +1 -0
  50. data/config/locales/hi.yml +1 -0
  51. data/config/locales/hr.yml +1 -0
  52. data/config/locales/hu.yml +1 -0
  53. data/config/locales/hy.yml +1 -0
  54. data/config/locales/id.yml +1 -0
  55. data/config/locales/is.yml +1 -0
  56. data/config/locales/it.yml +1 -0
  57. data/config/locales/ja.yml +1 -0
  58. data/config/locales/ka.yml +1 -0
  59. data/config/locales/kk.yml +1 -0
  60. data/config/locales/ko.yml +1 -0
  61. data/config/locales/lt.yml +1 -0
  62. data/config/locales/lv.yml +1 -0
  63. data/config/locales/ms.yml +1 -0
  64. data/config/locales/mt.yml +1 -0
  65. data/config/locales/nl.yml +1 -0
  66. data/config/locales/no.yml +1 -0
  67. data/config/locales/pa-pk.yml +1 -0
  68. data/config/locales/pa.yml +1 -0
  69. data/config/locales/pl.yml +1 -0
  70. data/config/locales/ps.yml +1 -0
  71. data/config/locales/pt.yml +1 -0
  72. data/config/locales/ro.yml +1 -0
  73. data/config/locales/ru.yml +1 -0
  74. data/config/locales/si.yml +1 -0
  75. data/config/locales/sk.yml +1 -0
  76. data/config/locales/sl.yml +1 -0
  77. data/config/locales/so.yml +1 -0
  78. data/config/locales/sq.yml +1 -0
  79. data/config/locales/sr.yml +1 -0
  80. data/config/locales/sv.yml +1 -0
  81. data/config/locales/sw.yml +1 -0
  82. data/config/locales/ta.yml +1 -0
  83. data/config/locales/th.yml +1 -0
  84. data/config/locales/tk.yml +1 -0
  85. data/config/locales/tr.yml +1 -0
  86. data/config/locales/uk.yml +1 -0
  87. data/config/locales/ur.yml +1 -0
  88. data/config/locales/uz.yml +1 -0
  89. data/config/locales/vi.yml +1 -0
  90. data/config/locales/zh-hk.yml +1 -0
  91. data/config/locales/zh-tw.yml +1 -0
  92. data/config/locales/zh.yml +1 -0
  93. data/lib/govuk_publishing_components/presenters/button_helper.rb +13 -2
  94. data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +5 -0
  95. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +15 -31
  96. data/lib/govuk_publishing_components/version.rb +1 -1
  97. metadata +68 -6
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d3b0fa1ddc43a2e926edce2c1f0417db5cbb0b1924caa41f91b817f3fc0d5647
4
- data.tar.gz: 9e165fe5648aa0d6be420b8a00517c5295b58d5c6050b4b55646c8924272338f
3
+ metadata.gz: '0970bb03929bfc783d477b903ce46f8f8fa47ad800b74303f61c4f2e473a914e'
4
+ data.tar.gz: e1bc0b5d89be175278b988b30b85269b7128fc9fa5fbb3286b582bf66c91b7f0
5
5
  SHA512:
6
- metadata.gz: 75bb0f5311883c23c5b83cfb18cf619acc923fed727d174f4d72ea8cae9aacd99e1a701889b72779cc76d72b2596a2e0d4765fa8c11a150c01c7554f95e76719
7
- data.tar.gz: 51c83f3aadc86d2ed048e34c739c4d2a976524855152890a392c1f633e8e371914bdf64525c6297c310b2855bd6062dddb80930923f994c61ca469dbbba88953
6
+ metadata.gz: 7dfb6d556b81cc890eec0fa6884a7738d2c47b0b5bba80d0f8b35788682ba8cd0c4d9528370f7175c3b2361f47592fa405ebb43e8b5fa43954fc57bc23960dcc
7
+ data.tar.gz: 3e58e5f9b229c8c85e734b74fd2ba98db39cd9f66ba80bab12cf8ac6acc8a482a059f200d9b721e530c190a6dff73915c9641377a77afaef5506eef8d4ca9aaf
@@ -1,2 +1,5 @@
1
1
  //= require_tree ./vendor
2
2
  //= require_tree .
3
+ //= require ../govuk_publishing_components/dependencies
4
+ //= require ../govuk_publishing_components/components/accordion
5
+ //= require ../govuk_publishing_components/components/tabs
@@ -293,8 +293,10 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
293
293
 
294
294
  // Navigate to and open accordions with anchored content on page load if a hash is present
295
295
  GemAccordion.prototype.openByAnchorOnLoad = function () {
296
- if (window.location.hash && this.$module.querySelector(window.location.hash)) {
297
- this.openForAnchor(window.location.hash)
296
+ var splitHash = window.location.hash.split('#')[1]
297
+
298
+ if (window.location.hash && document.getElementById(splitHash)) {
299
+ this.openForAnchor(splitHash)
298
300
  }
299
301
  }
300
302
 
@@ -305,20 +307,20 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
305
307
 
306
308
  links.forEach(function (link) {
307
309
  if (link.pathname === window.location.pathname) {
308
- link.addEventListener('click', this.openForAnchor.bind(this, link.hash))
310
+ link.addEventListener('click', this.openForAnchor.bind(this, link.hash.split('#')[1]))
309
311
  }
310
312
  }.bind(this))
311
313
  }
312
314
 
313
315
  // Find the parent accordion section for the given id and open it
314
316
  GemAccordion.prototype.openForAnchor = function (hash) {
315
- var target = document.querySelector(hash)
317
+ var target = document.getElementById(hash)
316
318
  var section = this.getContainingSection(target)
317
319
 
318
320
  this.setExpanded(true, section)
319
321
  }
320
322
 
321
- // Loop through the given ids ancestors until the parent section class is found
323
+ // Loop through the given id's ancestors until the parent section class is found
322
324
  GemAccordion.prototype.getContainingSection = function (target) {
323
325
  while (!target.classList.contains(this.sectionClass)) {
324
326
  target = target.parentElement
@@ -1,7 +1,8 @@
1
1
  /* eslint-env jquery */
2
2
  // = require govuk/components/details/details.js
3
3
  window.GOVUK = window.GOVUK || {}
4
- window.GOVUK.Modules = window.GOVUK.Modules || {};
4
+ window.GOVUK.Modules = window.GOVUK.Modules || {}
5
+ window.GOVUK.Modules.Details = window.GOVUKFrontend;
5
6
 
6
7
  (function (Modules) {
7
8
  function GovukDetails () { }
@@ -25,6 +25,7 @@
25
25
  govuk_browser_upgrade_dismisssed: 'settings',
26
26
  govuk_not_first_visit: 'settings',
27
27
  analytics_next_page_call: 'usage',
28
+ user_nation: 'settings',
28
29
  _ga: 'usage',
29
30
  _gid: 'usage',
30
31
  _gat: 'usage',
@@ -40,7 +40,9 @@
40
40
  module = new GOVUK.Modules[moduleName]()
41
41
  module.start(element)
42
42
  element.data('module-started', true)
43
- } else if ( // GOV.UK Frontend Modules
43
+ }
44
+
45
+ if ( // GOV.UK Frontend Modules
44
46
  typeof GOVUK.Modules[frontendModuleName] === 'function' &&
45
47
  GOVUK.Modules[frontendModuleName].prototype.init &&
46
48
  !started
@@ -148,7 +148,7 @@ $gem-guide-border-width: 1px;
148
148
 
149
149
  .component-guide-preview--simple {
150
150
  border: 0;
151
- padding: 0;
151
+ padding: govuk-spacing(2);
152
152
 
153
153
  &:before {
154
154
  display: none;
@@ -1,4 +1,13 @@
1
1
  .gem-c-layout-for-public {
2
- margin: 0;
3
2
  font-family: $govuk-font-family;
4
3
  }
4
+
5
+ .gem-c-layout-for-public__blue-bar {
6
+ background: $govuk-brand-colour;
7
+ height: govuk-spacing(2);
8
+ }
9
+
10
+ .js-enabled .gem-c-layout-for-public__global-banner-wrapper {
11
+ margin-top: - govuk-spacing(2);
12
+ position: relative;
13
+ }
@@ -78,12 +78,14 @@
78
78
  }
79
79
  }
80
80
 
81
- .gem-c-layout-header__search.govuk-grid-column-one-third-from-desktop,
82
- .gem-c-layout-header__logo.govuk-grid-column-one-third-from-desktop,
83
- .gem-c-layout-header__search.govuk-grid-column-one-third,
84
- .gem-c-layout-header__logo.govuk-grid-column-two-thirds {
85
- padding-right: 0;
86
- padding-left: 0;
81
+ @include govuk-compatibility(govuk_template) {
82
+ .gem-c-layout-header__search.govuk-grid-column-one-third-from-desktop,
83
+ .gem-c-layout-header__logo.govuk-grid-column-one-third-from-desktop,
84
+ .gem-c-layout-header__search.govuk-grid-column-one-third,
85
+ .gem-c-layout-header__logo.govuk-grid-column-two-thirds {
86
+ padding-right: 0;
87
+ padding-left: 0;
88
+ }
87
89
  }
88
90
 
89
91
  .gem-c-layout-header__logo,
@@ -104,7 +106,6 @@
104
106
 
105
107
  .gem-c-header__content.govuk-header__content {
106
108
  width: auto;
107
- padding-left: 0;
108
109
 
109
110
  @include govuk-media-query($from: desktop) {
110
111
  float: right;
@@ -9,7 +9,6 @@ $large-input-size: 50px;
9
9
  .gem-c-search__label {
10
10
  @include govuk-font($size: 19, $line-height: $input-size);
11
11
  display: block;
12
- background: govuk-colour("white");
13
12
  color: $govuk-text-colour;
14
13
 
15
14
  h1 {
@@ -25,6 +24,7 @@ $large-input-size: 50px;
25
24
  padding-left: govuk-spacing(3);
26
25
  z-index: 1;
27
26
  color: $govuk-secondary-text-colour;
27
+ background: govuk-colour("white");
28
28
  }
29
29
 
30
30
  // match label colour with the label component colour
@@ -144,6 +144,10 @@ $large-input-size: 50px;
144
144
  }
145
145
 
146
146
  .gem-c-search--on-govuk-blue {
147
+ .gem-c-search__label {
148
+ color: govuk-colour("white");
149
+ }
150
+
147
151
  .gem-c-search__input {
148
152
  border-width: 0;
149
153
 
@@ -191,9 +195,19 @@ $large-input-size: 50px;
191
195
  }
192
196
 
193
197
  .gem-c-search--no-border {
198
+ .gem-c-search__label {
199
+ color: govuk-colour("white");
200
+ }
201
+
194
202
  .gem-c-search__input[type="search"] {
195
203
  border: 0;
196
204
  }
205
+
206
+ .js-enabled & {
207
+ .gem-c-search__label {
208
+ color: $govuk-secondary-text-colour;
209
+ }
210
+ }
197
211
  }
198
212
 
199
213
  .gem-c-search--large {
@@ -38,3 +38,15 @@
38
38
  .gem-c-summary__block {
39
39
  @include govuk-responsive-margin(6, "bottom");
40
40
  }
41
+
42
+ .gem-c-summary-list--wide-title {
43
+ @include govuk-media-query($from: 'tablet') {
44
+ .govuk-summary-list__key {
45
+ width: 60%;
46
+ }
47
+
48
+ .govuk-summary-list__value {
49
+ width: 20%;
50
+ }
51
+ }
52
+ }
@@ -26,10 +26,5 @@
26
26
  }
27
27
 
28
28
  .gem-c-title__text {
29
- @extend %govuk-heading-xl;
30
29
  margin: 0;
31
30
  }
32
-
33
- .gem-c-title__text--long {
34
- @extend %govuk-heading-l;
35
- }
@@ -1,22 +1,7 @@
1
1
  module GovukPublishingComponents
2
2
  class AuditController < GovukPublishingComponents::ApplicationController
3
3
  def show
4
- path = Dir.pwd
5
-
6
- components = AuditComponents.new(path)
7
- applications = analyse_applications(File.expand_path("..", path))
8
- compared_data = AuditComparer.new(components.data, applications)
9
-
10
- @applications = compared_data.applications_data || []
11
- @components = compared_data.gem_data || []
12
- end
13
-
14
- private
15
-
16
- def analyse_applications(path)
17
- results = []
18
- applications = %w[
19
- calculators
4
+ application_dirs = %w[
20
5
  collections
21
6
  collections-publisher
22
7
  content-data-admin
@@ -42,10 +27,29 @@ module GovukPublishingComponents
42
27
  travel-advice-publisher
43
28
  whitehall
44
29
  ].sort
30
+ application_dirs = [GovukPublishingComponents::ApplicationHelper.get_application_name_from_path(Rails.root)] unless ENV["MAIN_COMPONENT_GUIDE"]
31
+
32
+ gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
33
+ gem_path = Dir.pwd if ENV["MAIN_COMPONENT_GUIDE"]
34
+
35
+ components = AuditComponents.new(gem_path, false)
36
+ applications = analyse_applications(File.expand_path("..", gem_path), application_dirs)
37
+ compared_data = AuditComparer.new(components.data, applications, false)
38
+
39
+ @applications = compared_data.applications_data || []
40
+ @components = compared_data.gem_data || []
41
+ end
42
+
43
+ private
44
+
45
+ def analyse_applications(path, application_dirs)
46
+ results = []
47
+ @applications_found = false
45
48
 
46
- applications.each do |application|
49
+ application_dirs.each do |application|
47
50
  application_path = [path, application].join("/")
48
51
  app = AuditApplications.new(application_path, application)
52
+ @applications_found = true if app.data[:application_found]
49
53
  results << app.data
50
54
  end
51
55
 
@@ -13,6 +13,7 @@ module GovukPublishingComponents
13
13
  @components_in_use_sass = components_in_use_sass(false)
14
14
  @components_in_use_print_sass = components_in_use_sass(true)
15
15
  @components_in_use_js = components_in_use_js
16
+ @index_audit_summary = index_audit_summary
16
17
  end
17
18
 
18
19
  def show
@@ -161,5 +162,13 @@ module GovukPublishingComponents
161
162
  h[:url] = component_doc_path(component_doc.id) if component_example
162
163
  end
163
164
  end
165
+
166
+ def index_audit_summary
167
+ components_gem_path = Gem.loaded_specs["govuk_publishing_components"].full_gem_path
168
+ components = AuditComponents.new(components_gem_path, true)
169
+ application = AuditApplications.new(@application_path, GovukPublishingComponents::ApplicationHelper.get_application_name_from_path(@application_path))
170
+ compared_data = AuditComparer.new(components.data, [application.data], true)
171
+ compared_data.applications_data[0]
172
+ end
164
173
  end
165
174
  end
@@ -1,4 +1,7 @@
1
1
  module GovukPublishingComponents
2
2
  module ApplicationHelper
3
+ def self.get_application_name_from_path(path)
4
+ path.to_s.split("/")[-1]
5
+ end
3
6
  end
4
7
  end
@@ -86,8 +86,8 @@ module GovukPublishingComponents
86
86
  gem_style_references = find_code_references(file, src, /gem-c-[-_a-zA-Z]+/)
87
87
  @gem_style_references << gem_style_references if gem_style_references
88
88
  end
89
- rescue StandardError
90
- puts "File #{file} not found"
89
+ rescue StandardError => e
90
+ puts e.message
91
91
  end
92
92
 
93
93
  components_found.flatten.uniq.sort
@@ -108,7 +108,7 @@ module GovukPublishingComponents
108
108
  end
109
109
 
110
110
  def find_code_references(file, src, regex)
111
- clean_file_path = /(?<=#{Regexp.escape(@path)}\/)[\/a-zA-Z_-]+.[a-zA-Z.]+/
111
+ clean_file_path = /(?<=#{Regexp.escape(@path.to_s)}\/)[\/a-zA-Z_-]+.[a-zA-Z.]+/
112
112
 
113
113
  return file[clean_file_path] if regex.match?(src)
114
114
  end
@@ -2,10 +2,10 @@ module GovukPublishingComponents
2
2
  class AuditComparer
3
3
  attr_reader :applications_data, :gem_data
4
4
 
5
- def initialize(gem_data, results)
5
+ def initialize(gem_data, results, simple)
6
6
  if gem_data[:gem_found]
7
7
  @gem_data = gem_data
8
- @applications_data = sort_results(results)
8
+ @applications_data = sort_results(results, simple)
9
9
  @gem_data[:components_by_application] = get_components_by_application || []
10
10
  end
11
11
  end
@@ -16,7 +16,8 @@ module GovukPublishingComponents
16
16
  key.to_s.gsub("_", " ").capitalize
17
17
  end
18
18
 
19
- def sort_results(results)
19
+ def sort_results(results, simple)
20
+ @simple = simple
20
21
  data = []
21
22
 
22
23
  results.each do |result|
@@ -40,10 +41,9 @@ module GovukPublishingComponents
40
41
  warnings << warn_about_jquery_references(result[:jquery_references])
41
42
  warnings = warnings.flatten
42
43
 
43
- data << {
44
- name: result[:name],
45
- application_found: result[:application_found],
46
- summary: [
44
+ summary = []
45
+ unless @simple
46
+ summary = [
47
47
  {
48
48
  name: "Components in templates",
49
49
  value: templates[:components].flatten.uniq.sort.join(", "),
@@ -64,7 +64,13 @@ module GovukPublishingComponents
64
64
  name: "Components in ruby",
65
65
  value: ruby[:components].join(", "),
66
66
  },
67
- ],
67
+ ]
68
+ end
69
+
70
+ data << {
71
+ name: result[:name],
72
+ application_found: result[:application_found],
73
+ summary: summary,
68
74
  warnings: warnings,
69
75
  warning_count: warnings.length,
70
76
  gem_style_references: result[:gem_style_references],
@@ -180,6 +186,8 @@ module GovukPublishingComponents
180
186
  end
181
187
 
182
188
  def get_components_by_application
189
+ return [] if @simple
190
+
183
191
  results = []
184
192
  found_something = false
185
193
 
@@ -2,16 +2,17 @@ module GovukPublishingComponents
2
2
  class AuditComponents
3
3
  attr_reader :data
4
4
 
5
- def initialize(path)
5
+ def initialize(path, simple)
6
6
  @data = {
7
7
  gem_found: false,
8
8
  }
9
- @data = compile_data(path) if Dir.exist?(path)
9
+ @data = compile_data(path, simple) if Dir.exist?(path)
10
10
  end
11
11
 
12
12
  private
13
13
 
14
- def compile_data(path)
14
+ def compile_data(path, simple)
15
+ @simple = simple
15
16
  templates_path = "app/views/govuk_publishing_components/components"
16
17
  stylesheets_path = "app/assets/stylesheets/govuk_publishing_components/components"
17
18
  print_stylesheets_path = "app/assets/stylesheets/govuk_publishing_components/components/print"
@@ -128,6 +129,8 @@ module GovukPublishingComponents
128
129
  end
129
130
 
130
131
  def list_all_component_details
132
+ return [] if @simple
133
+
131
134
  all_component_information = []
132
135
 
133
136
  @components.each do |component|
@@ -0,0 +1,126 @@
1
+ <%
2
+ title = "Applications"
3
+ title = "This application" unless ENV["MAIN_COMPONENT_GUIDE"]
4
+ %>
5
+ <%= render "govuk_publishing_components/components/heading", {
6
+ text: title,
7
+ font_size: "l",
8
+ margin_bottom: 6
9
+ } %>
10
+
11
+ <% if @applications.any? %>
12
+ <%= render "govuk_publishing_components/components/details", {
13
+ title: "How to use this information"
14
+ } do %>
15
+ <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>
16
+ <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>
17
+ <% end %>
18
+
19
+ <%
20
+ accordion_content = nil
21
+ summary = nil
22
+ %>
23
+ <% application_items = @applications.map do |application| %>
24
+ <%
25
+ summary = '<strong class="govuk-tag govuk-tag--red">Application not found</strong>'
26
+
27
+ if application[:application_found]
28
+ summary = "Warnings: 0"
29
+ summary = "Warnings: <strong class=\"govuk-tag govuk-tag--red\">#{application[:warning_count]}</strong>" if application[:warning_count] > 0
30
+ end
31
+ %>
32
+
33
+ <% accordion_content = capture do %>
34
+ <% if application[:application_found] %>
35
+ <% application[:warnings].each do |warning| %>
36
+ <p class="govuk-body">
37
+ <strong class="govuk-tag">Warn</strong>
38
+ <strong><%= warning[:component] %></strong> - <%= warning[:message] %>
39
+ </p>
40
+ <% end %>
41
+
42
+ <%= render "govuk_publishing_components/components/heading", {
43
+ text: "Components used",
44
+ font_size: "m",
45
+ margin_bottom: 4,
46
+ heading_level: 3,
47
+ } %>
48
+
49
+ <dl class="govuk-summary-list">
50
+ <% application[:summary].each do |item| %>
51
+ <div class="govuk-summary-list__row">
52
+ <dt class="govuk-summary-list__key">
53
+ <%= item[:name] %>
54
+ </dt>
55
+ <dd class="govuk-summary-list__value">
56
+ <% if item[:value].length > 0 %>
57
+ <%= item[:value] %>
58
+ <% else %>
59
+ None
60
+ <% end %>
61
+ </dd>
62
+ </div>
63
+ <% end %>
64
+ </dl>
65
+
66
+ <% if application[:gem_style_references].any? %>
67
+ <%= render "govuk_publishing_components/components/heading", {
68
+ text: "Component references",
69
+ font_size: "m",
70
+ margin_bottom: 4,
71
+ heading_level: 3,
72
+ } %>
73
+
74
+ <p class="govuk-body">This shows instances of `gem-c-` classes found in the application. If a reference is found in a stylesheet or in code a warning is created, as this could be a style override or hard coded component markup.</p>
75
+ <ul class="govuk-list govuk-list--bullet">
76
+ <% application[:gem_style_references].each do |ref| %>
77
+ <li><%= ref %></li>
78
+ <% end %>
79
+ </ul>
80
+ <% end %>
81
+
82
+ <% if application[:jquery_references].any? %>
83
+ <%= render "govuk_publishing_components/components/heading", {
84
+ text: "jQuery references",
85
+ font_size: "m",
86
+ margin_bottom: 4,
87
+ heading_level: 3,
88
+ } %>
89
+ <p class="govuk-body">This shows JavaScript files that might contain jQuery, which we are trying to remove our dependency on.</p>
90
+ <ul class="govuk-list govuk-list--bullet">
91
+ <% application[:jquery_references].each do |ref| %>
92
+ <li><%= ref %></li>
93
+ <% end %>
94
+ </ul>
95
+ <% end %>
96
+ <% else %>
97
+ <p class="govuk-body">This application was not found. This could be because you do not have this repository checked out locally.</p>
98
+ <% end %>
99
+ <% end %>
100
+
101
+ <%
102
+ {
103
+ heading: {
104
+ text: application[:name]
105
+ },
106
+ summary: {
107
+ text: sanitize(summary)
108
+ },
109
+ content: {
110
+ html: sanitize(accordion_content)
111
+ },
112
+ }
113
+ %>
114
+ <% end %>
115
+
116
+ <% if ENV["MAIN_COMPONENT_GUIDE"] %>
117
+ <%= render "govuk_publishing_components/components/accordion", {
118
+ items: application_items
119
+ } %>
120
+ <% else %>
121
+ <p class="govuk-body"><%= sanitize(summary) %></p>
122
+ <%= accordion_content %>
123
+ <% end %>
124
+ <% else %>
125
+ <p class="govuk-body">No applications found.</p>
126
+ <% end %>