govuk_publishing_components 24.7.0 → 24.9.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/component_guide/application.js +3 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +35 -4
- data/app/assets/javascripts/govuk_publishing_components/lib/cookie-functions.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/magna-charta.js +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +0 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +0 -8
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +2 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_highlight-boxes.scss +1 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +1 -11
- data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -32
- data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +0 -5
- data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +0 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +16 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +15 -0
- data/app/controllers/govuk_publishing_components/audit_controller.rb +21 -17
- data/app/controllers/govuk_publishing_components/component_guide_controller.rb +9 -0
- data/app/helpers/govuk_publishing_components/application_helper.rb +3 -0
- data/app/models/govuk_publishing_components/audit_applications.rb +3 -3
- data/app/models/govuk_publishing_components/audit_comparer.rb +16 -8
- data/app/models/govuk_publishing_components/audit_components.rb +6 -3
- data/app/views/govuk_publishing_components/audit/_applications.html.erb +126 -0
- data/app/views/govuk_publishing_components/audit/_components.html.erb +142 -0
- data/app/views/govuk_publishing_components/audit/show.html.erb +22 -277
- data/app/views/govuk_publishing_components/component_guide/index.html.erb +18 -2
- data/app/views/govuk_publishing_components/component_guide/show.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +25 -0
- data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +14 -11
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +7 -2
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +4 -4
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_success_alert.html.erb +24 -8
- data/app/views/govuk_publishing_components/components/_title.html.erb +6 -2
- data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/docs/accordion.yml +73 -73
- data/app/views/govuk_publishing_components/components/docs/button.yml +7 -6
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +12 -0
- data/app/views/govuk_publishing_components/components/docs/modal_dialogue.yml +3 -0
- data/app/views/govuk_publishing_components/components/docs/success_alert.yml +12 -1
- data/config/locales/ar.yml +1 -0
- data/config/locales/az.yml +1 -0
- data/config/locales/be.yml +1 -0
- data/config/locales/bg.yml +1 -0
- data/config/locales/bn.yml +1 -0
- data/config/locales/cs.yml +1 -0
- data/config/locales/da.yml +1 -0
- data/config/locales/de.yml +1 -0
- data/config/locales/dr.yml +1 -0
- data/config/locales/el.yml +1 -0
- data/config/locales/en.yml +11 -0
- data/config/locales/es-419.yml +1 -0
- data/config/locales/es.yml +1 -0
- data/config/locales/fa.yml +1 -0
- data/config/locales/fi.yml +1 -0
- data/config/locales/gd.yml +1 -0
- data/config/locales/gu.yml +1 -0
- data/config/locales/he.yml +1 -0
- data/config/locales/hi.yml +1 -0
- data/config/locales/hr.yml +1 -0
- data/config/locales/hu.yml +1 -0
- data/config/locales/hy.yml +1 -0
- data/config/locales/id.yml +1 -0
- data/config/locales/is.yml +1 -0
- data/config/locales/it.yml +1 -0
- data/config/locales/ja.yml +1 -0
- data/config/locales/ka.yml +1 -0
- data/config/locales/kk.yml +1 -0
- data/config/locales/ko.yml +1 -0
- data/config/locales/lt.yml +1 -0
- data/config/locales/lv.yml +1 -0
- data/config/locales/ms.yml +1 -0
- data/config/locales/mt.yml +1 -0
- data/config/locales/nl.yml +1 -0
- data/config/locales/no.yml +1 -0
- data/config/locales/pa-pk.yml +1 -0
- data/config/locales/pa.yml +1 -0
- data/config/locales/pl.yml +1 -0
- data/config/locales/ps.yml +1 -0
- data/config/locales/pt.yml +1 -0
- data/config/locales/ro.yml +1 -0
- data/config/locales/ru.yml +1 -0
- data/config/locales/si.yml +1 -0
- data/config/locales/sk.yml +1 -0
- data/config/locales/sl.yml +1 -0
- data/config/locales/so.yml +1 -0
- data/config/locales/sq.yml +1 -0
- data/config/locales/sr.yml +1 -0
- data/config/locales/sv.yml +1 -0
- data/config/locales/sw.yml +1 -0
- data/config/locales/ta.yml +1 -0
- data/config/locales/th.yml +1 -0
- data/config/locales/tk.yml +1 -0
- data/config/locales/tr.yml +1 -0
- data/config/locales/uk.yml +1 -0
- data/config/locales/ur.yml +1 -0
- data/config/locales/uz.yml +1 -0
- data/config/locales/vi.yml +1 -0
- data/config/locales/zh-hk.yml +1 -0
- data/config/locales/zh-tw.yml +1 -0
- data/config/locales/zh.yml +1 -0
- data/lib/govuk_publishing_components/presenters/button_helper.rb +13 -2
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +0 -4
- data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +15 -31
- data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +1 -0
- data/lib/govuk_publishing_components/presenters/shared_helper.rb +10 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +84 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9ad726f2e544e7165c409104245f6b1e8e0c9bf97c4e10984db45411cc007892
|
|
4
|
+
data.tar.gz: 7aca349410d2615a5ba3810bdd90c4a355477dc017c7e72f9b626c35630139ba
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 850ab9d67ae304803e0060aa16c969cc621df866eca8ea15eff8617e68d0149e618d0cc946da6da4b5bce7549033b8d60f0fb93d0fd316fe60e0f0ce75df606d
|
|
7
|
+
data.tar.gz: 9cdda0e734f05dd8c89e3bebd17800401492977650cfa2016eb51abec02362f1faf3d0668b33b2ead3067386b1c8c278a5fda1a269fb40685c0d23f659dc5343
|
|
@@ -31,7 +31,16 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
31
31
|
this.upChevonIconClass = 'gem-c-accordion-nav__chevron'
|
|
32
32
|
this.downChevonIconClass = 'gem-c-accordion-nav__chevron--down'
|
|
33
33
|
|
|
34
|
-
//
|
|
34
|
+
// Translated component content and language attribute pulled from data attributes
|
|
35
|
+
this.$module.actions = {}
|
|
36
|
+
this.$module.actions.locale = this.$module.getAttribute('data-locale')
|
|
37
|
+
this.$module.actions.showText = this.$module.getAttribute('data-show-text')
|
|
38
|
+
this.$module.actions.hideText = this.$module.getAttribute('data-hide-text')
|
|
39
|
+
this.$module.actions.showAllText = this.$module.getAttribute('data-show-all-text')
|
|
40
|
+
this.$module.actions.hideAllText = this.$module.getAttribute('data-hide-all-text')
|
|
41
|
+
this.$module.actions.thisSectionVisuallyHidden = this.$module.getAttribute('data-this-section-visually-hidden')
|
|
42
|
+
|
|
43
|
+
// Indicate that JavaScript has worked
|
|
35
44
|
this.$module.classList.add('gem-c-accordion--active')
|
|
36
45
|
|
|
37
46
|
this.initControls()
|
|
@@ -117,7 +126,11 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
117
126
|
// Build additional copy for assistive technology
|
|
118
127
|
var srAdditionalCopy = document.createElement('span')
|
|
119
128
|
srAdditionalCopy.classList.add('govuk-visually-hidden')
|
|
120
|
-
srAdditionalCopy.innerHTML =
|
|
129
|
+
srAdditionalCopy.innerHTML = this.$module.actions.thisSectionVisuallyHidden
|
|
130
|
+
|
|
131
|
+
if (this.$module.actions.locale) {
|
|
132
|
+
srAdditionalCopy.lang = this.filterLocale('this_section_visually_hidden')
|
|
133
|
+
}
|
|
121
134
|
|
|
122
135
|
// Build additional wrapper for toggle text, place icon after wrapped text.
|
|
123
136
|
var wrapperShowHideIcon = document.createElement('span')
|
|
@@ -178,12 +191,16 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
178
191
|
var icon = section.querySelector('.' + this.upChevonIconClass)
|
|
179
192
|
var showHideText = section.querySelector('.' + this.sectionShowHideTextClass)
|
|
180
193
|
var button = section.querySelector('.' + this.sectionButtonClass)
|
|
181
|
-
var newButtonText = expanded ?
|
|
194
|
+
var newButtonText = expanded ? this.$module.actions.hideText : this.$module.actions.showText
|
|
182
195
|
|
|
183
196
|
showHideText.innerHTML = newButtonText
|
|
184
197
|
button.setAttribute('aria-expanded', expanded)
|
|
185
198
|
button.classList.add(this.toggleLinkClass)
|
|
186
199
|
|
|
200
|
+
if (this.$module.actions.locale) {
|
|
201
|
+
showHideText.lang = this.filterLocale(expanded ? 'hide_text' : 'show_text')
|
|
202
|
+
}
|
|
203
|
+
|
|
187
204
|
// Swap icon, change class
|
|
188
205
|
if (expanded) {
|
|
189
206
|
section.classList.add(this.sectionExpandedClass)
|
|
@@ -218,10 +235,15 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
218
235
|
GemAccordion.prototype.updateOpenAllButton = function (expanded) {
|
|
219
236
|
var icon = this.openAllButton.querySelector('.' + this.upChevonIconClass)
|
|
220
237
|
var openAllCopy = this.openAllButton.querySelector('.' + this.openAllTextClass)
|
|
221
|
-
var newButtonText = expanded ?
|
|
238
|
+
var newButtonText = expanded ? this.$module.actions.hideAllText : this.$module.actions.showAllText
|
|
239
|
+
|
|
222
240
|
this.openAllButton.setAttribute('aria-expanded', expanded)
|
|
223
241
|
openAllCopy.innerHTML = newButtonText
|
|
224
242
|
|
|
243
|
+
if (this.$module.actions.locale) {
|
|
244
|
+
openAllCopy.lang = this.filterLocale(expanded ? 'hide_all_text' : 'show_all_text')
|
|
245
|
+
}
|
|
246
|
+
|
|
225
247
|
// Swap icon, toggle class
|
|
226
248
|
if (expanded) {
|
|
227
249
|
icon.classList.remove(this.downChevonIconClass)
|
|
@@ -329,5 +351,14 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
329
351
|
return target
|
|
330
352
|
}
|
|
331
353
|
|
|
354
|
+
GemAccordion.prototype.filterLocale = function (key) {
|
|
355
|
+
if (this.$module.actions.locale && this.$module.actions.locale.indexOf('{') !== -1) {
|
|
356
|
+
var locales = JSON.parse(this.$module.actions.locale)
|
|
357
|
+
return locales[key]
|
|
358
|
+
} else if (this.$module.actions.locale) {
|
|
359
|
+
return this.$module.actions.locale
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
|
|
332
363
|
Modules.GemAccordion = GemAccordion
|
|
333
364
|
})(window.GOVUK.Modules)
|
|
@@ -188,7 +188,7 @@ window.GOVUK.Modules = window.GOVUK.Modules || {};
|
|
|
188
188
|
toggleStatus.classList.add('govuk-visually-hidden', 'mc-toggle-status')
|
|
189
189
|
toggleStatus.setAttribute('role', 'alert')
|
|
190
190
|
|
|
191
|
-
link.classList.add('mc-toggle-button')
|
|
191
|
+
link.classList.add('govuk-body-s', 'mc-toggle-button')
|
|
192
192
|
link.appendChild(toggleText)
|
|
193
193
|
link.appendChild(toggleStatus)
|
|
194
194
|
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
@import "govuk/components/button/button";
|
|
2
2
|
|
|
3
|
-
$gem-secondary-button-colour: #00823b;
|
|
4
|
-
$gem-secondary-button-hover-colour: darken($gem-secondary-button-colour, 5%);
|
|
5
|
-
$gem-secondary-button-background-colour: govuk-colour("white");
|
|
6
|
-
$gem-secondary-button-hover-background-colour: govuk-colour("light-grey", $legacy: "grey-4");
|
|
7
|
-
|
|
8
|
-
$gem-quiet-button-colour: govuk-colour("dark-grey", $legacy: "grey-1");
|
|
9
|
-
$gem-quiet-button-hover-colour: darken($gem-quiet-button-colour, 5%);
|
|
10
|
-
|
|
11
3
|
// Because govuk-frontend adds a responsive bottom margin by default for each component
|
|
12
4
|
// we reset it to zero so we can set it separately using `gem-c-button--bottom-margin`
|
|
13
5
|
// If we decide to use responsive margins consistently across components we can remove this
|
|
@@ -6,7 +6,6 @@ $transition-campaign-dark-blue: #1e1348;
|
|
|
6
6
|
}
|
|
7
7
|
|
|
8
8
|
.gem-c-contextual-sidebar__brexit-heading {
|
|
9
|
-
@extend %govuk-heading-s;
|
|
10
9
|
margin-top: govuk-spacing(3);
|
|
11
10
|
margin-bottom: govuk-spacing(2);
|
|
12
11
|
}
|
|
@@ -24,7 +23,6 @@ $transition-campaign-dark-blue: #1e1348;
|
|
|
24
23
|
}
|
|
25
24
|
|
|
26
25
|
.gem-c-contextual-sidebar__brexit-text {
|
|
27
|
-
@extend %govuk-link;
|
|
28
26
|
@include govuk-font(16);
|
|
29
27
|
|
|
30
28
|
margin-top: 0;
|
|
@@ -38,6 +36,8 @@ $transition-campaign-dark-blue: #1e1348;
|
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
.gem-c-contextual-sidebar__brexit-cta:focus {
|
|
39
|
+
box-shadow: 0 $govuk-focus-width $govuk-focus-text-colour;
|
|
40
|
+
|
|
41
41
|
.gem-c-contextual-sidebar__brexit-text {
|
|
42
42
|
text-decoration: none;
|
|
43
43
|
}
|
|
@@ -50,11 +50,10 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.gem-c-highlight-boxes__title {
|
|
53
|
-
@extend %govuk-link;
|
|
54
53
|
@include govuk-font(19, $weight: bold);
|
|
55
54
|
display: block;
|
|
56
55
|
text-decoration: underline;
|
|
57
|
-
margin-bottom:
|
|
56
|
+
margin-bottom: govuk-spacing(1);
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
.gem-c-highlight-boxes--inverse .gem-c-highlight-boxes__title {
|
|
@@ -59,12 +59,10 @@
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
.gem-c-image-card__title {
|
|
62
|
-
@include govuk-font(19, $weight: bold);
|
|
63
62
|
margin: 0;
|
|
64
63
|
}
|
|
65
64
|
|
|
66
65
|
.gem-c-image-card__title-link {
|
|
67
|
-
@extend %govuk-link;
|
|
68
66
|
text-decoration: none;
|
|
69
67
|
|
|
70
68
|
&:hover {
|
|
@@ -136,7 +134,6 @@
|
|
|
136
134
|
}
|
|
137
135
|
|
|
138
136
|
.gem-c-image-card__list-item-link {
|
|
139
|
-
@extend %govuk-link;
|
|
140
137
|
line-height: 1.35em;
|
|
141
138
|
}
|
|
142
139
|
|
|
@@ -193,7 +190,6 @@
|
|
|
193
190
|
}
|
|
194
191
|
|
|
195
192
|
.gem-c-image-card__title {
|
|
196
|
-
@include govuk-font(24, $weight: bold);
|
|
197
193
|
padding-bottom: govuk-spacing(2);
|
|
198
194
|
}
|
|
199
195
|
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
.gem-c-layout-header--search-left {
|
|
34
34
|
.gem-c-header__menu-button.govuk-header__menu-button {
|
|
35
35
|
margin-top: - govuk-spacing(7);
|
|
36
|
-
left:
|
|
36
|
+
left: govuk-spacing(3);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
.gem-c-header__nav-wrapper {
|
|
@@ -78,16 +78,6 @@
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
|
|
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
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
81
|
.gem-c-layout-header__logo,
|
|
92
82
|
.gem-c-layout-header__search {
|
|
93
83
|
@include govuk-media-query($until: "tablet") {
|
|
@@ -1,36 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
color: $govuk-text-colour;
|
|
3
|
-
padding: govuk-spacing(3);
|
|
4
|
-
border: $govuk-border-width-narrow solid $govuk-success-colour;
|
|
5
|
-
@include govuk-responsive-margin(8, "bottom");
|
|
6
|
-
|
|
7
|
-
@include govuk-media-query($from: tablet) {
|
|
8
|
-
padding: govuk-spacing(4);
|
|
9
|
-
border-width: $govuk-border-width;
|
|
10
|
-
}
|
|
11
|
-
}
|
|
1
|
+
@import "govuk/components/notification-banner/notification-banner";
|
|
12
2
|
|
|
13
3
|
.gem-c-success-alert__message {
|
|
14
4
|
@include govuk-font(19, $weight: bold);
|
|
15
|
-
margin: 0;
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
.gem-c-success-summary__title {
|
|
19
|
-
margin-top: 0;
|
|
20
|
-
margin-bottom: govuk-spacing(3);
|
|
21
|
-
|
|
22
|
-
@include govuk-media-query($from: tablet) {
|
|
23
|
-
margin-bottom: govuk-spacing(4);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
@include govuk-font(24, $weight: bold);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.gem-c-success-summary__body {
|
|
30
|
-
@include govuk-font(19);
|
|
31
|
-
margin: 0;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
.gem-c-success-alert:focus {
|
|
35
|
-
outline: $govuk-focus-width solid $govuk-focus-colour;
|
|
36
5
|
}
|
|
@@ -1,7 +1,21 @@
|
|
|
1
|
-
@import "govuk/components/button/button";
|
|
2
|
-
|
|
3
1
|
// stylelint-disable scss/at-extend-no-missing-placeholder
|
|
4
2
|
.gem-c-govspeak {
|
|
3
|
+
@import "govuk/components/button/button";
|
|
4
|
+
|
|
5
|
+
// Some links in Govspeak should look like buttons[1] when using:
|
|
6
|
+
// ```
|
|
7
|
+
// {button}[Random page](https://gov.uk/random){/button}
|
|
8
|
+
// ```.
|
|
9
|
+
//
|
|
10
|
+
// To make sure that the link styles don't override the button styles this
|
|
11
|
+
// needs more specificity.
|
|
12
|
+
//
|
|
13
|
+
// Govspeak targets link by using element selectors; so the selector
|
|
14
|
+
// `.gem-c-govspeak a:link` will override `.govuk-button`. Extending
|
|
15
|
+
// `govuk-button` here gives `gem-c-govspeak .gem-c-button` and prevents the
|
|
16
|
+
// link-that-looks-like-a-button from being overriden.
|
|
17
|
+
|
|
18
|
+
// [1]: https://github.com/alphagov/govspeak#button
|
|
5
19
|
.gem-c-button {
|
|
6
20
|
@extend .govuk-button;
|
|
7
21
|
}
|
|
@@ -2,3 +2,18 @@
|
|
|
2
2
|
// It provides govuk-frontend but adds no weight to the compiled CSS
|
|
3
3
|
@import "components/helpers/govuk-frontend-settings";
|
|
4
4
|
@import "govuk/base";
|
|
5
|
+
|
|
6
|
+
@import 'components/mixins/margins';
|
|
7
|
+
// TODO: remove this focus override when govuk_template is no longer used
|
|
8
|
+
@import 'components/mixins/govuk-template-link-focus-override';
|
|
9
|
+
@import 'components/mixins/css3';
|
|
10
|
+
|
|
11
|
+
$gem-secondary-button-colour: #00823b;
|
|
12
|
+
$gem-secondary-button-hover-colour: darken($gem-secondary-button-colour, 5%);
|
|
13
|
+
$gem-secondary-button-background-colour: govuk-colour("white");
|
|
14
|
+
$gem-secondary-button-hover-background-colour: govuk-colour("light-grey", $legacy: "grey-4");
|
|
15
|
+
|
|
16
|
+
$gem-quiet-button-colour: govuk-colour("dark-grey", $legacy: "grey-1");
|
|
17
|
+
$gem-quiet-button-hover-colour: darken($gem-quiet-button-colour, 5%);
|
|
18
|
+
|
|
19
|
+
$gem-hover-dark-background: #dddcdb;
|
|
@@ -1,22 +1,7 @@
|
|
|
1
1
|
module GovukPublishingComponents
|
|
2
2
|
class AuditController < GovukPublishingComponents::ApplicationController
|
|
3
3
|
def show
|
|
4
|
-
|
|
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
|
-
|
|
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
|
|