govuk_publishing_components 21.56.2 → 21.60.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +31 -6
- data/app/assets/javascripts/component_guide/accessibility-test.js +21 -21
- data/app/assets/javascripts/component_guide/filter-components.js +19 -19
- data/app/assets/javascripts/component_guide/visual-regression.js +38 -37
- data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +2 -2
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +6 -4
- data/app/assets/javascripts/govuk_publishing_components/components/print-link.js +14 -0
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +4 -4
- data/app/assets/javascripts/govuk_publishing_components/lib/auto-track-event.js +31 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +24 -24
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +17 -17
- data/app/assets/stylesheets/component_guide/application.scss +15 -15
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +9 -11
- data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +5 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +4 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +3 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +5 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_list.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +52 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +4 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +7 -3
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +0 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +1 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +8 -12
- data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +21 -24
- data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +4 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +2 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_markdown-typography.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_govspeak.scss +7 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav-header.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/print/_step-by-step-nav.scss +2 -10
- data/app/controllers/govuk_publishing_components/audit_controller.rb +52 -0
- data/app/controllers/govuk_publishing_components/component_guide_controller.rb +2 -1
- data/app/models/govuk_publishing_components/audit_applications.rb +105 -0
- data/app/models/govuk_publishing_components/audit_comparer.rb +185 -0
- data/app/models/govuk_publishing_components/audit_components.rb +158 -0
- data/app/views/govuk_publishing_components/audit/show.html.erb +229 -0
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +9 -4
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_list.html.erb +26 -0
- data/app/views/govuk_publishing_components/components/_machine_readable_metadata.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +27 -0
- data/app/views/govuk_publishing_components/components/_radio.html.erb +13 -5
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/docs/action_link.yml +5 -0
- data/app/views/govuk_publishing_components/components/docs/checkboxes.yml +4 -0
- data/app/views/govuk_publishing_components/components/docs/heading.yml +6 -3
- data/app/views/govuk_publishing_components/components/docs/list.yml +64 -0
- data/app/views/govuk_publishing_components/components/docs/print_link.yml +24 -0
- data/app/views/govuk_publishing_components/components/docs/radio.yml +4 -0
- data/config/locales/en.yml +2 -0
- data/config/routes.rb +1 -0
- data/lib/govuk_publishing_components/presenters/checkboxes_helper.rb +15 -7
- data/lib/govuk_publishing_components/presenters/heading_helper.rb +21 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/package.json +145 -220
- data/node_modules/govuk-frontend/package.json +14 -81
- data/node_modules/jquery/package.json +44 -116
- metadata +50 -66
- data/Rakefile +0 -32
@@ -0,0 +1,229 @@
|
|
1
|
+
<% content_for :title, "Component audit" %>
|
2
|
+
|
3
|
+
<%= render 'govuk_publishing_components/components/title', title: "Components audit", margin_top: 0; %>
|
4
|
+
|
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>
|
24
|
+
|
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 %>
|
93
|
+
</div>
|
94
|
+
<% else %>
|
95
|
+
<p class="govuk-body">No applications found.</p>
|
96
|
+
<% end %>
|
97
|
+
</div>
|
98
|
+
|
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">
|
104
|
+
<div class="govuk-accordion__section ">
|
105
|
+
<div class="govuk-accordion__section-header">
|
106
|
+
<h2 class="govuk-accordion__section-heading">
|
107
|
+
<span class="govuk-accordion__section-button" id="accordion-default-heading-1">
|
108
|
+
Component files
|
109
|
+
</span>
|
110
|
+
</h2>
|
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>
|
159
|
+
<% 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
|
174
|
+
</div>
|
175
|
+
</div>
|
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>
|
187
|
+
<% end %>
|
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? %>
|
204
|
+
<dl class="govuk-summary-list">
|
205
|
+
<% @components[:components_by_application].each do |component| %>
|
206
|
+
<div class="govuk-summary-list__row">
|
207
|
+
<dt class="govuk-summary-list__key">
|
208
|
+
<%= component[:component] %> (<%= component[:count] %>)
|
209
|
+
</dt>
|
210
|
+
<dd class="govuk-summary-list__value">
|
211
|
+
<%= component[:list] %>
|
212
|
+
</dd>
|
213
|
+
</div>
|
214
|
+
<% end %>
|
215
|
+
</dl>
|
216
|
+
<% else %>
|
217
|
+
<p class="govuk-body">Sorry, no applications found.</p>
|
218
|
+
<% end %>
|
219
|
+
</div>
|
220
|
+
</div>
|
221
|
+
</div>
|
222
|
+
<% else %>
|
223
|
+
<p class="govuk-body">No components found.</p>
|
224
|
+
<% end %>
|
225
|
+
</div>
|
226
|
+
</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 %>
|
@@ -2,12 +2,13 @@
|
|
2
2
|
|
3
3
|
<div class="component-markdown">
|
4
4
|
<p>Components are packages of template, style, behaviour and documentation that live in your application.</p>
|
5
|
-
<p>
|
5
|
+
<p>See the <a href="https://github.com/alphagov/govuk_publishing_components">govuk_publishing_components gem</a> for further details, or <a href="https://docs.publishing.service.gov.uk/manual/components.html#component-guides">a list of all component guides</a>.</p>
|
6
6
|
<ul>
|
7
|
-
<li
|
8
|
-
|
7
|
+
<li>Read about how to <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/docs/publishing-to-rubygems.md">release a new version of the gem</a></li>
|
8
|
+
<% if ENV["MAIN_COMPONENT_GUIDE"] %>
|
9
|
+
<li><a href="/component-guide/audit">View component audits</a></li>
|
10
|
+
<% end %>
|
9
11
|
</ul>
|
10
|
-
<p>See the <a href="https://github.com/alphagov/govuk_publishing_components">govuk_publishing_components gem</a> for further details, or <a href="https://docs.publishing.service.gov.uk/manual/components.html#component-guides">a list of all component guides</a>.</p>
|
11
12
|
</div>
|
12
13
|
|
13
14
|
<form role="search" data-module="filter-components" class="component-search">
|
@@ -86,3 +87,7 @@
|
|
86
87
|
</li>
|
87
88
|
<% end %>
|
88
89
|
</ul>
|
90
|
+
|
91
|
+
<div class="component-markdown">
|
92
|
+
<p class="govuk-body">If you cannot find a suitable component consider extending an existing component or <a href="https://github.com/alphagov/govuk_publishing_components/blob/master/docs/develop-component.md">creating a new one</a>.</p>
|
93
|
+
</div>
|
@@ -11,6 +11,7 @@
|
|
11
11
|
light_text ||= false
|
12
12
|
simple ||= false
|
13
13
|
dark_icon ||= false
|
14
|
+
small_icon ||= false
|
14
15
|
nhs_icon ||= false
|
15
16
|
data ||= nil
|
16
17
|
classes ||= nil
|
@@ -18,6 +19,7 @@
|
|
18
19
|
css_classes = %w(gem-c-action-link)
|
19
20
|
css_classes << "gem-c-action-link--light-text" if light_text
|
20
21
|
css_classes << "gem-c-action-link--dark-icon" if dark_icon
|
22
|
+
css_classes << "gem-c-action-link--small-icon" if small_icon
|
21
23
|
css_classes << "gem-c-action-link--nhs" if nhs_icon
|
22
24
|
css_classes << "gem-c-action-link--simple" if simple
|
23
25
|
css_classes << "gem-c-action-link--with-subtext" if subtext
|
@@ -5,9 +5,11 @@
|
|
5
5
|
cookie_preferences_href ||= "/help/cookies"
|
6
6
|
confirmation_message ||= raw("You’ve accepted all cookies. You can <a class='govuk-link' href='#{cookie_preferences_href}' data-module='track-click' data-track-category='cookieBanner' data-track-action='Cookie banner settings clicked from confirmation'>change your cookie settings</a> at any time.")
|
7
7
|
services_cookies ||= nil
|
8
|
+
css_classes = %w(gem-c-cookie-banner govuk-clearfix)
|
9
|
+
css_classes << "gem-c-cookie-banner--services" if services_cookies
|
8
10
|
%>
|
9
11
|
|
10
|
-
<div id="<%= id %>" class="
|
12
|
+
<div id="<%= id %>" class="<%= css_classes.join(' ') %>" data-module="cookie-banner" role="region" aria-label="cookie banner" data-nosnippet>
|
11
13
|
<div class="gem-c-cookie-banner__wrapper govuk-width-container">
|
12
14
|
<div class="govuk-grid-row">
|
13
15
|
<div class="govuk-grid-column-two-thirds">
|
@@ -0,0 +1,26 @@
|
|
1
|
+
<%
|
2
|
+
id ||= nil
|
3
|
+
extra_spacing ||= nil
|
4
|
+
list_type ||= "unordered"
|
5
|
+
visible_counters ||= nil
|
6
|
+
items ||= []
|
7
|
+
aria_label ||= nil
|
8
|
+
|
9
|
+
classes = %w(gem-c-list govuk-list)
|
10
|
+
classes << "govuk-list--bullet" if visible_counters && list_type === "unordered"
|
11
|
+
classes << "govuk-list--number" if visible_counters && list_type === "number"
|
12
|
+
classes << "govuk-list--spaced" if extra_spacing
|
13
|
+
|
14
|
+
# Default list type is unordered list.
|
15
|
+
list_tag = "ul"
|
16
|
+
|
17
|
+
# Set to ordered list to override default.
|
18
|
+
list_tag = "ol" if list_type === "number"
|
19
|
+
%>
|
20
|
+
<% if items.any? %>
|
21
|
+
<%= content_tag list_tag, class: classes, id: id, "aria-label": aria_label do %>
|
22
|
+
<% items.each do |item| %>
|
23
|
+
<li><%= sanitize(item) %></li>
|
24
|
+
<% end %>
|
25
|
+
<% end %>
|
26
|
+
<% end %>
|
@@ -9,7 +9,7 @@
|
|
9
9
|
<% structured_data = GovukPublishingComponents::Presenters::SchemaOrg.new(page).structured_data %>
|
10
10
|
|
11
11
|
<script type="application/ld+json">
|
12
|
-
<%= raw structured_data
|
12
|
+
<%= raw JSON.pretty_generate(structured_data) %>
|
13
13
|
</script>
|
14
14
|
|
15
15
|
<link rel="canonical" href="<%= page.canonical_url %>" />
|
@@ -0,0 +1,27 @@
|
|
1
|
+
<%
|
2
|
+
text ||= t('components.print_link.text')
|
3
|
+
href ||= nil
|
4
|
+
data_attributes ||= {}
|
5
|
+
|
6
|
+
require_js ||= href.nil?
|
7
|
+
data_attributes[:module] = 'print-link' if require_js
|
8
|
+
%>
|
9
|
+
|
10
|
+
<% if require_js %>
|
11
|
+
<div class="gem-c-print-link" >
|
12
|
+
<%= content_tag(:button, text, {
|
13
|
+
class: %w(gem-c-print-link__button govuk-link),
|
14
|
+
data: data_attributes
|
15
|
+
}) %>
|
16
|
+
</div>
|
17
|
+
<% else %>
|
18
|
+
<div class="gem-c-print-link gem-c-print-link--show-without-js">
|
19
|
+
<%= link_to(
|
20
|
+
text,
|
21
|
+
href,
|
22
|
+
class: %w(gem-c-print-link__link govuk-link),
|
23
|
+
rel: "alternate",
|
24
|
+
data: data_attributes
|
25
|
+
) %>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
@@ -6,10 +6,18 @@
|
|
6
6
|
label ||= nil
|
7
7
|
heading ||= nil
|
8
8
|
heading_caption ||= nil
|
9
|
+
heading_size ||= nil
|
9
10
|
small ||= false
|
10
11
|
inline ||= false
|
11
12
|
is_page_heading ||= false
|
12
|
-
|
13
|
+
|
14
|
+
if ['s', 'm', 'l', 'xl'].include?(heading_size)
|
15
|
+
size = heading_size
|
16
|
+
elsif is_page_heading
|
17
|
+
size = 'xl'
|
18
|
+
else
|
19
|
+
size = 'm'
|
20
|
+
end
|
13
21
|
|
14
22
|
description ||= nil
|
15
23
|
hint ||= nil
|
@@ -28,7 +36,7 @@
|
|
28
36
|
radio_classes << "govuk-radios--inline" if inline
|
29
37
|
|
30
38
|
legend_classes = %w(govuk-fieldset__legend)
|
31
|
-
legend_classes << "govuk-fieldset__legend--#{
|
39
|
+
legend_classes << "govuk-fieldset__legend--#{size}"
|
32
40
|
|
33
41
|
aria = "#{hint_id} #{"#{error_id}" if has_error}".strip if hint or has_error
|
34
42
|
|
@@ -40,9 +48,9 @@
|
|
40
48
|
|
41
49
|
<% if heading.present? %>
|
42
50
|
<% if is_page_heading %>
|
43
|
-
<%= tag.legend class:
|
44
|
-
<%= tag.span(heading_caption, class: "govuk-caption
|
45
|
-
<%= tag.h1 heading, class: "gem-c-
|
51
|
+
<%= tag.legend class: legend_classes do %>
|
52
|
+
<%= tag.span(heading_caption, class: "govuk-caption-#{size}") if heading_caption.present? %>
|
53
|
+
<%= tag.h1 heading, class: "gem-c-radio__heading-text govuk-fieldset__heading" %>
|
46
54
|
<% end %>
|
47
55
|
<% else %>
|
48
56
|
<%= tag.legend heading, class: legend_classes %>
|
@@ -25,14 +25,14 @@
|
|
25
25
|
%>
|
26
26
|
<% if title %>
|
27
27
|
<script type="application/ld+json">
|
28
|
-
<%= raw breadcrumb_presenter.structured_data
|
28
|
+
<%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
|
29
29
|
</script>
|
30
30
|
|
31
31
|
<div class="<%= classes %>" data-module="track-click">
|
32
32
|
<span class="gem-c-step-nav-header__part-of">Part of</span>
|
33
33
|
<% if path %>
|
34
34
|
<a href="<%= path %>"
|
35
|
-
class="gem-c-step-nav-header__title"
|
35
|
+
class="gem-c-step-nav-header__title govuk-link"
|
36
36
|
data-track-category="<%= tracking_category %>"
|
37
37
|
data-track-action="<%= tracking_action %>"
|
38
38
|
data-track-label="<%= tracking_label %>"
|
@@ -75,6 +75,11 @@ examples:
|
|
75
75
|
text: Getting financial help and keeping your business safe
|
76
76
|
href: "/financial-help"
|
77
77
|
simple: true
|
78
|
+
with_small_icon:
|
79
|
+
data:
|
80
|
+
text: Coronavirus (COVID-19)
|
81
|
+
href: "/my-test-page"
|
82
|
+
small_icon: true
|
78
83
|
with_dark_icon:
|
79
84
|
data:
|
80
85
|
text: Coronavirus (COVID-19)
|
@@ -184,6 +184,10 @@ examples:
|
|
184
184
|
- label: "Blue"
|
185
185
|
value: "blue"
|
186
186
|
with_custom_heading_size:
|
187
|
+
description: |
|
188
|
+
This allows the size of the legend to be changed. Valid options are s, m, l, xl, defaulting to m if no option is passed.
|
189
|
+
|
190
|
+
If the is_page_heading option is true and heading_size is not set, the text size will be xl.
|
187
191
|
data:
|
188
192
|
name: "favourite_colour"
|
189
193
|
heading: "What is your favourite colour?"
|
@@ -24,10 +24,13 @@ examples:
|
|
24
24
|
text: 'Original consultation'
|
25
25
|
heading_level: 3
|
26
26
|
different_font_sizes:
|
27
|
-
description:
|
27
|
+
description: |
|
28
|
+
Set a different font size for the heading. Uses the [GOV.UK Frontend heading sizes](https://design-system.service.gov.uk/styles/typography/#headings) but defaults to 27px for legacy reasons. Valid options are `xl`, `l`, `m` and `s`.
|
29
|
+
|
30
|
+
This option is not tied to the heading_level option in order to give flexibility.
|
28
31
|
data:
|
29
|
-
text: '
|
30
|
-
font_size:
|
32
|
+
text: 'One big heading'
|
33
|
+
font_size: "xl"
|
31
34
|
with_id_attribute:
|
32
35
|
data:
|
33
36
|
text: 'Detail of outcome'
|