govuk_publishing_components 23.15.0 → 24.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +28 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +330 -4
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +26 -10
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +23 -14
- data/app/assets/javascripts/govuk_publishing_components/vendor/polyfills/common.js +8 -0
- data/app/assets/stylesheets/component_guide/application.scss +0 -8
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/component_support.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +298 -14
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +7 -87
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +21 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +105 -48
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +8 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +0 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_accordion.scss +17 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +1 -11
- data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
- data/app/views/govuk_publishing_components/audit/show.html.erb +211 -199
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +15 -22
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +47 -36
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +10 -1
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_document.svg → _thumbnail_document.html.erb} +0 -0
- data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_generic.svg → _thumbnail_generic.html.erb} +0 -0
- data/app/views/govuk_publishing_components/components/attachment/{_thumbnail_spreadsheet.svg → _thumbnail_spreadsheet.html.erb} +0 -0
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +37 -3
- data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +5 -0
- data/app/views/govuk_publishing_components/components/docs/cookie_banner.yml +9 -0
- data/app/views/govuk_publishing_components/components/docs/document_list.yml +18 -0
- data/app/views/govuk_publishing_components/components/docs/govspeak.yml +3 -3
- data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +1 -1
- data/config/initializers/assets.rb +0 -1
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +61 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/govuk-frontend/govuk/all.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/fixtures.json +10 -10
- data/node_modules/govuk-frontend/govuk/components/breadcrumbs/template.njk +2 -2
- data/node_modules/govuk-frontend/govuk/components/button/_index.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +1 -0
- data/node_modules/govuk-frontend/govuk/components/character-count/character-count.js +1 -1
- data/node_modules/govuk-frontend/govuk/components/character-count/fixtures.json +13 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_cookie-banner.scss +2 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/_index.scss +51 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/fixtures.json +425 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro-options.json +132 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/macro.njk +3 -0
- data/node_modules/govuk-frontend/govuk/components/cookie-banner/template.njk +63 -0
- data/node_modules/govuk-frontend/govuk/components/details/fixtures.json +2 -2
- data/node_modules/govuk-frontend/govuk/components/header/fixtures.json +18 -18
- data/node_modules/govuk-frontend/govuk/components/header/template.njk +4 -4
- data/node_modules/govuk-frontend/govuk/components/table/_index.scss +21 -0
- data/node_modules/govuk-frontend/govuk/components/table/macro-options.json +2 -2
- data/node_modules/govuk-frontend/govuk/objects/_all.scss +1 -0
- data/node_modules/govuk-frontend/govuk/objects/_button-group.scss +94 -0
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +13 -20
- data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small-focus.svg +0 -4
- data/app/assets/images/govuk_publishing_components/chevron-banner/chevron-banner-small.svg +0 -4
- data/app/assets/javascripts/govuk_publishing_components/components/header.js +0 -8
- data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +0 -31
- data/app/assets/stylesheets/govuk_publishing_components/components/_chevron-banner.scss +0 -138
- data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_variables.scss +0 -27
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_back-arrow.scss +0 -13
- data/app/assets/stylesheets/govuk_publishing_components/components/mixins/_clearfix.scss +0 -8
- data/app/views/govuk_publishing_components/components/_chevron_banner.html.erb +0 -19
- data/app/views/govuk_publishing_components/components/_subscription-links.html.erb +0 -85
- data/app/views/govuk_publishing_components/components/_translation-nav.html.erb +0 -33
- data/app/views/govuk_publishing_components/components/docs/chevron_banner.yml +0 -33
- data/app/views/govuk_publishing_components/components/docs/subscription-links.yml +0 -103
- data/app/views/govuk_publishing_components/components/docs/translation-nav.yml +0 -139
@@ -1,12 +1,12 @@
|
|
1
1
|
.gem-c-success-alert {
|
2
|
-
color: $
|
3
|
-
padding:
|
4
|
-
border: $
|
2
|
+
color: $govuk-text-colour;
|
3
|
+
padding: govuk-spacing(3);
|
4
|
+
border: $govuk-border-width-narrow solid $govuk-success-colour;
|
5
5
|
@include govuk-responsive-margin(8, "bottom");
|
6
6
|
|
7
7
|
@include govuk-media-query($from: tablet) {
|
8
|
-
padding:
|
9
|
-
border-width: $
|
8
|
+
padding: govuk-spacing(4);
|
9
|
+
border-width: $govuk-border-width;
|
10
10
|
}
|
11
11
|
}
|
12
12
|
|
@@ -17,10 +17,10 @@
|
|
17
17
|
|
18
18
|
.gem-c-success-summary__title {
|
19
19
|
margin-top: 0;
|
20
|
-
margin-bottom:
|
20
|
+
margin-bottom: govuk-spacing(3);
|
21
21
|
|
22
22
|
@include govuk-media-query($from: tablet) {
|
23
|
-
margin-bottom:
|
23
|
+
margin-bottom: govuk-spacing(4);
|
24
24
|
}
|
25
25
|
|
26
26
|
@include govuk-font(24, $weight: bold);
|
@@ -32,5 +32,5 @@
|
|
32
32
|
}
|
33
33
|
|
34
34
|
.gem-c-success-alert:focus {
|
35
|
-
outline: $
|
35
|
+
outline: $govuk-focus-width solid $govuk-focus-colour;
|
36
36
|
}
|
@@ -2,30 +2,38 @@
|
|
2
2
|
//
|
3
3
|
// TODO: Replace with the print styles that will come from GOV.UK Frontend.
|
4
4
|
|
5
|
+
@import "govuk_publishing_components/component_support";
|
5
6
|
@import "../accordion";
|
6
7
|
|
7
8
|
// Open all of the accordion sections.
|
8
|
-
.
|
9
|
+
.gem-c-accordion__section-content {
|
9
10
|
display: block !important; // stylelint-disable-line declaration-no-important
|
10
11
|
}
|
11
12
|
|
12
13
|
// Change the colour from the blue link colour to black.
|
13
|
-
.
|
14
|
+
.gem-c-accordion__section-button {
|
14
15
|
color: govuk-colour("black") !important; // stylelint-disable-line declaration-no-important
|
15
16
|
}
|
16
17
|
|
18
|
+
// Removing spacing
|
19
|
+
.gem-c-accordion__section-header {
|
20
|
+
padding-bottom: govuk-spacing(1);
|
21
|
+
}
|
22
|
+
|
17
23
|
// Change the summary subheading size.
|
18
|
-
.
|
24
|
+
.gem-c-accordion__section-summary {
|
19
25
|
@include govuk-typography-common;
|
20
26
|
@include govuk-typography-responsive($size: 16, $important: true);
|
27
|
+
}
|
21
28
|
|
22
|
-
|
23
|
-
|
24
|
-
|
29
|
+
// Hide the unusable "Show all sections" button and the "Chevron" icons.
|
30
|
+
.gem-c-accordion__open-all,
|
31
|
+
.gem-c-accordion__icon,
|
32
|
+
.gem-c-accordion__toggle-link {
|
33
|
+
display: none !important; // stylelint-disable-line declaration-no-important
|
25
34
|
}
|
26
35
|
|
27
|
-
// Hide
|
28
|
-
.govuk-
|
29
|
-
.govuk-accordion__icon {
|
36
|
+
// Hide all hidden content
|
37
|
+
.gem-c-accordion .govuk-visually-hidden {
|
30
38
|
display: none !important; // stylelint-disable-line declaration-no-important
|
31
39
|
}
|
data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
$grey-2: #bfc1c3;
|
2
2
|
$white: #ffffff;
|
3
3
|
$number-circle-size: 35px;
|
4
|
-
$stroke-width:
|
4
|
+
$stroke-width: 1px;
|
5
5
|
|
6
6
|
.gem-c-step-nav:not(.gem-c-step-nav--large),
|
7
7
|
.gem-c-step-nav__controls,
|
@@ -63,7 +63,7 @@ $stroke-width: 3px;
|
|
63
63
|
}
|
64
64
|
|
65
65
|
.gem-c-step-nav__circle--number {
|
66
|
-
border: solid
|
66
|
+
border: solid 1px $grey-2;
|
67
67
|
}
|
68
68
|
|
69
69
|
.gem-c-step-nav__step,
|
@@ -1,14 +1,4 @@
|
|
1
1
|
// This file should be included in an application prior to specific components
|
2
2
|
// It provides govuk-frontend but adds no weight to the compiled CSS
|
3
3
|
@import "components/helpers/govuk-frontend-settings";
|
4
|
-
@import "govuk/
|
5
|
-
@import "govuk/tools/all";
|
6
|
-
@import "govuk/helpers/all";
|
7
|
-
$govuk-colours-organisations: map-merge(
|
8
|
-
$govuk-colours-organisations,
|
9
|
-
(
|
10
|
-
"foreign-commonwealth-development-office": (
|
11
|
-
colour: #012169
|
12
|
-
)
|
13
|
-
)
|
14
|
-
);
|
4
|
+
@import "govuk/base";
|
@@ -14,7 +14,7 @@ module GovukPublishingComponents
|
|
14
14
|
stylesheets = Dir["#{path}/app/assets/stylesheets/**/*.scss"]
|
15
15
|
javascripts = Dir["#{path}/app/assets/javascripts/**/*.js"]
|
16
16
|
|
17
|
-
find_components = /(?<=govuk_publishing_components\/components\/)[
|
17
|
+
find_components = /(?<=govuk_publishing_components\/components\/)[a-zA-Z_-]+(?=['"])/
|
18
18
|
|
19
19
|
@find_all_stylesheets = /@import ["']{1}govuk_publishing_components\/all_components/
|
20
20
|
find_stylesheets = /(?<=@import ["']{1}govuk_publishing_components\/components\/)(?!print\/)+[a-zA-Z_-]+(?=['"])/
|
@@ -39,98 +39,105 @@
|
|
39
39
|
</div>
|
40
40
|
</details>
|
41
41
|
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
<h2 class="govuk-accordion__section-heading">
|
47
|
-
<span class="govuk-accordion__section-button" id="accordion-with-summary-sections-heading-<%= index %>">
|
48
|
-
<%= application[:name] %>
|
49
|
-
</span>
|
50
|
-
</h2>
|
51
|
-
<div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-<%= index %>">
|
52
|
-
<% if application[:application_found] %>
|
53
|
-
Warnings:
|
54
|
-
<% if application[:warning_count] > 0 %>
|
55
|
-
<strong class="govuk-tag govuk-tag--red"><%= application[:warning_count] %></strong>
|
56
|
-
<% else %>
|
57
|
-
<%= application[:warning_count] %>
|
58
|
-
<% end %>
|
59
|
-
<% else %>
|
60
|
-
<strong class="govuk-tag govuk-tag--red">Application not found</strong>
|
61
|
-
<% end %>
|
62
|
-
</div>
|
63
|
-
</div>
|
64
|
-
<div id="accordion-with-summary-sections-content-<%= index %>" class="govuk-accordion__section-content" aria-labelledby="accordion-with-summary-sections-heading-<%= index %>">
|
65
|
-
<% if application[:application_found] %>
|
66
|
-
<% application[:warnings].each do |warning| %>
|
67
|
-
<p class="govuk-body">
|
68
|
-
<strong class="govuk-tag">Warn</strong>
|
69
|
-
<strong><%= warning[:component] %></strong> - <%= warning[:message] %>
|
70
|
-
</p>
|
71
|
-
<% end %>
|
42
|
+
<% #application_items = [] %>
|
43
|
+
<% application_items = @applications.map do |application| %>
|
44
|
+
<%
|
45
|
+
summary = '<strong class="govuk-tag govuk-tag--red">Application not found</strong>'
|
72
46
|
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
47
|
+
if application[:application_found]
|
48
|
+
summary = "Warnings: 0"
|
49
|
+
if application[:warning_count] > 0
|
50
|
+
summary = "Warnings: <strong class=\"govuk-tag govuk-tag--red\">#{application[:warning_count]}</strong>"
|
51
|
+
end
|
52
|
+
end
|
53
|
+
%>
|
79
54
|
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
<%= item[:value] %>
|
89
|
-
<% else %>
|
90
|
-
None
|
91
|
-
<% end %>
|
92
|
-
</dd>
|
93
|
-
</div>
|
94
|
-
<% end %>
|
95
|
-
</dl>
|
55
|
+
<% accordion_content = capture do %>
|
56
|
+
<% if application[:application_found] %>
|
57
|
+
<% application[:warnings].each do |warning| %>
|
58
|
+
<p class="govuk-body">
|
59
|
+
<strong class="govuk-tag">Warn</strong>
|
60
|
+
<strong><%= warning[:component] %></strong> - <%= warning[:message] %>
|
61
|
+
</p>
|
62
|
+
<% end %>
|
96
63
|
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
} %>
|
64
|
+
<%= render "govuk_publishing_components/components/heading", {
|
65
|
+
text: "Components used",
|
66
|
+
font_size: "m",
|
67
|
+
margin_bottom: 4,
|
68
|
+
heading_level: 3,
|
69
|
+
} %>
|
104
70
|
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
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
|
109
82
|
<% end %>
|
110
|
-
</
|
83
|
+
</dd>
|
84
|
+
</div>
|
85
|
+
<% end %>
|
86
|
+
</dl>
|
87
|
+
|
88
|
+
<% if application[:gem_style_references].any? %>
|
89
|
+
<%= render "govuk_publishing_components/components/heading", {
|
90
|
+
text: "Component references",
|
91
|
+
font_size: "m",
|
92
|
+
margin_bottom: 4,
|
93
|
+
heading_level: 3,
|
94
|
+
} %>
|
95
|
+
|
96
|
+
<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>
|
97
|
+
<ul class="govuk-list govuk-list--bullet">
|
98
|
+
<% application[:gem_style_references].each do |ref| %>
|
99
|
+
<li><%= ref %></li>
|
111
100
|
<% end %>
|
101
|
+
</ul>
|
102
|
+
<% end %>
|
112
103
|
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
<% end %>
|
125
|
-
</ul>
|
104
|
+
<% if application[:jquery_references].any? %>
|
105
|
+
<%= render "govuk_publishing_components/components/heading", {
|
106
|
+
text: "jQuery references",
|
107
|
+
font_size: "m",
|
108
|
+
margin_bottom: 4,
|
109
|
+
heading_level: 3,
|
110
|
+
} %>
|
111
|
+
<p class="govuk-body">This shows JavaScript files that might contain jQuery, which we are trying to remove our dependency on.</p>
|
112
|
+
<ul class="govuk-list govuk-list--bullet">
|
113
|
+
<% application[:jquery_references].each do |ref| %>
|
114
|
+
<li><%= ref %></li>
|
126
115
|
<% end %>
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
116
|
+
</ul>
|
117
|
+
<% end %>
|
118
|
+
<% else %>
|
119
|
+
<p class="govuk-body">This application was not found. This could be because you do not have this repository checked out locally.</p>
|
120
|
+
<% end %>
|
132
121
|
<% end %>
|
133
|
-
|
122
|
+
|
123
|
+
<%
|
124
|
+
{
|
125
|
+
heading: {
|
126
|
+
text: application[:name]
|
127
|
+
},
|
128
|
+
summary: {
|
129
|
+
text: sanitize(summary)
|
130
|
+
},
|
131
|
+
content: {
|
132
|
+
html: sanitize(accordion_content)
|
133
|
+
},
|
134
|
+
}
|
135
|
+
%>
|
136
|
+
<% end %>
|
137
|
+
|
138
|
+
<%= render "govuk_publishing_components/components/accordion", {
|
139
|
+
items: application_items
|
140
|
+
} %>
|
134
141
|
<% else %>
|
135
142
|
<p class="govuk-body">No applications found.</p>
|
136
143
|
<% end %>
|
@@ -144,125 +151,130 @@
|
|
144
151
|
} %>
|
145
152
|
|
146
153
|
<% if @components.any? %>
|
147
|
-
|
148
|
-
<
|
149
|
-
<
|
150
|
-
<
|
151
|
-
<
|
152
|
-
|
153
|
-
</
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
</
|
158
|
-
</
|
159
|
-
<
|
160
|
-
|
161
|
-
<
|
162
|
-
<
|
163
|
-
<
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
</
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
<
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
<
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
<
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
<% end %>
|
196
|
-
</td>
|
197
|
-
<td class="govuk-table__cell">
|
198
|
-
<% if component[:js_tests] %>
|
199
|
-
<strong class="govuk-tag govuk-tag--green">Yes</strong>
|
200
|
-
<% end %>
|
201
|
-
</td>
|
202
|
-
</tr>
|
203
|
-
<% end %>
|
204
|
-
</tbody>
|
205
|
-
</table>
|
206
|
-
</div>
|
207
|
-
</div>
|
154
|
+
<% component_files = capture do %>
|
155
|
+
<table class="govuk-table">
|
156
|
+
<thead class="govuk-table__head">
|
157
|
+
<tr class="govuk-table__row">
|
158
|
+
<th scope="col" class="govuk-table__header sticky-table-header">Component</th>
|
159
|
+
<th scope="col" class="govuk-table__header sticky-table-header">Stylesheet</th>
|
160
|
+
<th scope="col" class="govuk-table__header sticky-table-header">Print stylesheet</th>
|
161
|
+
<th scope="col" class="govuk-table__header sticky-table-header">JS</th>
|
162
|
+
<th scope="col" class="govuk-table__header sticky-table-header">Test</th>
|
163
|
+
<th scope="col" class="govuk-table__header sticky-table-header">JS test</th>
|
164
|
+
</tr>
|
165
|
+
</thead>
|
166
|
+
<tbody class="govuk-table__body">
|
167
|
+
<% @components[:component_listing].each do |component| %>
|
168
|
+
<tr class="govuk-table__row">
|
169
|
+
<th scope="row" class="govuk-table__header">
|
170
|
+
<a href="<%= component[:link] %>" class="govuk-link"><%= component[:name] %></a>
|
171
|
+
</th>
|
172
|
+
<td class="govuk-table__cell">
|
173
|
+
<% if component[:stylesheet] %>
|
174
|
+
<strong class="govuk-tag govuk-tag--green">Yes</strong>
|
175
|
+
<% end %>
|
176
|
+
</td>
|
177
|
+
<td class="govuk-table__cell">
|
178
|
+
<% if component[:print_stylesheet] %>
|
179
|
+
<strong class="govuk-tag govuk-tag--green">Yes</strong>
|
180
|
+
<% end %>
|
181
|
+
</td>
|
182
|
+
<td class="govuk-table__cell">
|
183
|
+
<% if component[:javascript] %>
|
184
|
+
<strong class="govuk-tag govuk-tag--green">Yes</strong>
|
185
|
+
<% end %>
|
186
|
+
</td>
|
187
|
+
<td class="govuk-table__cell">
|
188
|
+
<% if component[:tests] %>
|
189
|
+
<strong class="govuk-tag govuk-tag--green">Yes</strong>
|
190
|
+
<% end %>
|
191
|
+
</td>
|
192
|
+
<td class="govuk-table__cell">
|
193
|
+
<% if component[:js_tests] %>
|
194
|
+
<strong class="govuk-tag govuk-tag--green">Yes</strong>
|
195
|
+
<% end %>
|
196
|
+
</td>
|
197
|
+
</tr>
|
198
|
+
<% end %>
|
199
|
+
</tbody>
|
200
|
+
</table>
|
201
|
+
<% end %>
|
208
202
|
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
</div>
|
220
|
-
<div id="accordion-default-content-2" class="govuk-accordion__section-content" aria-labelledby="accordion-default-heading-2">
|
221
|
-
<dl class="govuk-summary-list">
|
222
|
-
<% @components[:components_containing_components].each do |component| %>
|
223
|
-
<div class="govuk-summary-list__row">
|
224
|
-
<dt class="govuk-summary-list__key">
|
225
|
-
<a href="<%= component[:link] %>" class="govuk-link"><%= component[:component] %></a>
|
226
|
-
</dt>
|
227
|
-
<dd class="govuk-summary-list__value">
|
228
|
-
<%= component[:sub_components].join(', ') %>
|
229
|
-
</dd>
|
230
|
-
</div>
|
231
|
-
<% end %>
|
232
|
-
</dl>
|
233
|
-
</div>
|
234
|
-
</div>
|
235
|
-
<div class="govuk-accordion__section ">
|
236
|
-
<div class="govuk-accordion__section-header">
|
237
|
-
<h2 class="govuk-accordion__section-heading">
|
238
|
-
<span class="govuk-accordion__section-button" id="accordion-default-heading-2">
|
239
|
-
Components by application
|
240
|
-
</span>
|
241
|
-
</h2>
|
242
|
-
<div class="govuk-accordion__section-summary govuk-body" id="accordion-with-summary-sections-summary-2">
|
243
|
-
Shows which applications use each component
|
203
|
+
<% components_within_components = capture do %>
|
204
|
+
<dl class="govuk-summary-list">
|
205
|
+
<% @components[:components_containing_components].each do |component| %>
|
206
|
+
<div class="govuk-summary-list__row">
|
207
|
+
<dt class="govuk-summary-list__key">
|
208
|
+
<a href="<%= component[:link] %>" class="govuk-link"><%= component[:component] %></a>
|
209
|
+
</dt>
|
210
|
+
<dd class="govuk-summary-list__value">
|
211
|
+
<%= component[:sub_components].join(', ') %>
|
212
|
+
</dd>
|
244
213
|
</div>
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
<p class="govuk-body">Sorry, no applications found.</p>
|
214
|
+
<% end %>
|
215
|
+
</dl>
|
216
|
+
<% end %>
|
217
|
+
|
218
|
+
<% components_by_application = capture do %>
|
219
|
+
<% if @components[:components_by_application].any? %>
|
220
|
+
<dl class="govuk-summary-list">
|
221
|
+
<% @components[:components_by_application].each do |component| %>
|
222
|
+
<div class="govuk-summary-list__row">
|
223
|
+
<dt class="govuk-summary-list__key">
|
224
|
+
<%= component[:component] %> (<%= component[:count] %>)
|
225
|
+
</dt>
|
226
|
+
<dd class="govuk-summary-list__value">
|
227
|
+
<%= component[:list] %>
|
228
|
+
</dd>
|
229
|
+
</div>
|
262
230
|
<% end %>
|
263
|
-
</
|
264
|
-
|
265
|
-
|
231
|
+
</dl>
|
232
|
+
<% else %>
|
233
|
+
<p class="govuk-body">Sorry, no applications found.</p>
|
234
|
+
<% end %>
|
235
|
+
<% end %>
|
236
|
+
|
237
|
+
<%
|
238
|
+
component_items = [
|
239
|
+
{
|
240
|
+
heading: {
|
241
|
+
text: "Component files",
|
242
|
+
},
|
243
|
+
summary: {
|
244
|
+
text: "Lists what files each component has",
|
245
|
+
},
|
246
|
+
content: {
|
247
|
+
html: component_files
|
248
|
+
},
|
249
|
+
},
|
250
|
+
{
|
251
|
+
heading: {
|
252
|
+
text: "Components containing other components",
|
253
|
+
},
|
254
|
+
summary: {
|
255
|
+
text: "Shows which components contain other components",
|
256
|
+
},
|
257
|
+
content: {
|
258
|
+
html: components_within_components
|
259
|
+
},
|
260
|
+
},
|
261
|
+
{
|
262
|
+
heading: {
|
263
|
+
text: "Components by application",
|
264
|
+
},
|
265
|
+
summary: {
|
266
|
+
text: "Shows which applications use each component",
|
267
|
+
},
|
268
|
+
content: {
|
269
|
+
html: components_by_application
|
270
|
+
},
|
271
|
+
},
|
272
|
+
]
|
273
|
+
%>
|
274
|
+
|
275
|
+
<%= render "govuk_publishing_components/components/accordion", {
|
276
|
+
items: component_items
|
277
|
+
} %>
|
266
278
|
<% else %>
|
267
279
|
<p class="govuk-body">No components found.</p>
|
268
280
|
<% end %>
|