govuk_publishing_components 24.3.0 → 24.3.1
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/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +8 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +17 -13
- data/app/models/govuk_publishing_components/audit_applications.rb +1 -1
- data/app/models/govuk_publishing_components/audit_comparer.rb +2 -2
- data/app/models/govuk_publishing_components/component_example.rb +4 -3
- data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +6 -6
- data/app/views/govuk_publishing_components/components/_highlight_boxes.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_taxonomy_list.html.erb +1 -1
- 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/inverse_header.yml +1 -1
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +2 -2
- data/lib/govuk_publishing_components/app_helpers/table_helper.rb +2 -1
- data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +1 -1
- data/lib/govuk_publishing_components/presenters/machine_readable/html_publication_schema.rb +1 -7
- data/lib/govuk_publishing_components/presenters/meta_tags.rb +1 -2
- data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +2 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/tasks/govuk_publishing_components_tasks.rake +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cbfbb444f86b61f46e110ab8615ca02b163357d6bf3125c4f4459bed3da8b92d
|
|
4
|
+
data.tar.gz: 012a4752e5fd69378516db6348f18b14902714dc56e209951879f490af850f77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 94f375971a2803179d77d070ee86113ea6e6a17d5e547d94c7229b7fcd643b2e8636eccb1f03369e26bb074517bdf411312826a721701efd55363fab244033a2
|
|
7
|
+
data.tar.gz: 62c13a38b68951a6492044e29b4a7989ea2ea62e185b58c307707bdbbe9a013e4db03dc7c52b7d378f04474be5e8505751e5395d4c58f5d6cc8e8ded2a9ede83
|
|
@@ -46,11 +46,18 @@ $govuk-cookie-banner-background: govuk-colour("light-grey", "grey-4");
|
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
+
// Override style from design system so we can have consistent
|
|
50
|
+
// padding on the the banner and the confirmation
|
|
51
|
+
|
|
52
|
+
.govuk-cookie-banner {
|
|
53
|
+
padding-top: 0;
|
|
54
|
+
}
|
|
55
|
+
|
|
49
56
|
// Override the styles from govuk_template
|
|
50
57
|
// stylelint-disable selector-max-id
|
|
51
58
|
.gem-c-cookie-banner#global-cookie-message {
|
|
52
59
|
background-color: $govuk-cookie-banner-background;
|
|
53
|
-
padding: 0;
|
|
60
|
+
padding: govuk-spacing(3) 0 0 0;
|
|
54
61
|
box-sizing: border-box;
|
|
55
62
|
|
|
56
63
|
.gem-c-cookie-banner__message,
|
|
@@ -34,6 +34,21 @@ $large-input-size: 50px;
|
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
+
%gem-c-search-input-focus {
|
|
38
|
+
outline: $govuk-focus-width solid $govuk-focus-colour;
|
|
39
|
+
// Ensure outline appears outside of the element
|
|
40
|
+
outline-offset: 0;
|
|
41
|
+
// Double the border by adding its width again. Use `box-shadow` for this // instead of changing `border-width`
|
|
42
|
+
// Also, `outline` cannot be utilised here as it is already used for the yellow focus state.
|
|
43
|
+
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
|
44
|
+
|
|
45
|
+
@include govuk-if-ie8 {
|
|
46
|
+
// IE8 doesn't support `box-shadow` so double the border with
|
|
47
|
+
// `border-width`.
|
|
48
|
+
border-width: $govuk-border-width-form-element * 2;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
37
52
|
.gem-c-search__input[type="search"] { // overly specific to prevent some overrides from outside
|
|
38
53
|
@include govuk-font($size: 19, $line-height: (28 / 19));
|
|
39
54
|
margin: 0;
|
|
@@ -59,25 +74,14 @@ $large-input-size: 50px;
|
|
|
59
74
|
}
|
|
60
75
|
|
|
61
76
|
&:focus {
|
|
62
|
-
|
|
63
|
-
// Ensure outline appears outside of the element
|
|
64
|
-
outline-offset: 0;
|
|
65
|
-
// Double the border by adding its width again. Use `box-shadow` for this // instead of changing `border-width`
|
|
66
|
-
// Also, `outline` cannot be utilised here as it is already used for the yellow focus state.
|
|
67
|
-
box-shadow: inset 0 0 0 $govuk-border-width-form-element;
|
|
68
|
-
|
|
69
|
-
@include govuk-if-ie8 {
|
|
70
|
-
// IE8 doesn't support `box-shadow` so double the border with
|
|
71
|
-
// `border-width`.
|
|
72
|
-
border-width: $govuk-border-width-form-element * 2;
|
|
73
|
-
}
|
|
77
|
+
@extend %gem-c-search-input-focus;
|
|
74
78
|
}
|
|
75
79
|
}
|
|
76
80
|
|
|
77
81
|
@include govuk-compatibility(govuk_template) {
|
|
78
82
|
// ultra specific rule overrides focus styling from govuk_template
|
|
79
83
|
#global-header .gem-c-search__input[type="search"]:focus { // stylelint-disable selector-max-id
|
|
80
|
-
@extend
|
|
84
|
+
@extend %gem-c-search-input-focus;
|
|
81
85
|
}
|
|
82
86
|
}
|
|
83
87
|
|
|
@@ -22,7 +22,7 @@ module GovukPublishingComponents
|
|
|
22
22
|
@find_all_print_stylesheets = /@import ["']{1}govuk_publishing_components\/all_components_print/
|
|
23
23
|
find_print_stylesheets = /(?<=@import ["']{1}govuk_publishing_components\/components\/print\/)[a-zA-Z_-]+(?=['"])/
|
|
24
24
|
|
|
25
|
-
@find_all_javascripts = /\/\/
|
|
25
|
+
@find_all_javascripts = /\/\/ *= require govuk_publishing_components\/all_components/
|
|
26
26
|
find_javascripts = /(?<=require govuk_publishing_components\/components\/)[a-zA-Z_-]+/
|
|
27
27
|
|
|
28
28
|
components_in_templates = find_components(templates, find_components, "templates") || []
|
|
@@ -110,8 +110,8 @@ module GovukPublishingComponents
|
|
|
110
110
|
next if second[:components].include?("all")
|
|
111
111
|
|
|
112
112
|
in_current.each do |component|
|
|
113
|
-
if @gem_data.include?("component_#{second_location}".to_sym)
|
|
114
|
-
warnings << create_warning(component, "Included in #{first_location} but not #{second_location}")
|
|
113
|
+
if @gem_data.include?("component_#{second_location}".to_sym) && @gem_data["component_#{second_location}".to_sym].include?(component)
|
|
114
|
+
warnings << create_warning(component, "Included in #{first_location} but not #{second_location}")
|
|
115
115
|
end
|
|
116
116
|
end
|
|
117
117
|
end
|
|
@@ -57,13 +57,14 @@ module GovukPublishingComponents
|
|
|
57
57
|
# Safe HTML can be passed to components, simulate
|
|
58
58
|
# by marking any string that comes from YAML as safe
|
|
59
59
|
def html_safe_strings(obj)
|
|
60
|
-
|
|
60
|
+
case obj
|
|
61
|
+
when String
|
|
61
62
|
obj.html_safe
|
|
62
|
-
|
|
63
|
+
when Hash
|
|
63
64
|
obj.each do |key, value|
|
|
64
65
|
obj[key] = html_safe_strings(value)
|
|
65
66
|
end
|
|
66
|
-
|
|
67
|
+
when Array
|
|
67
68
|
obj.map! { |e| html_safe_strings(e) }
|
|
68
69
|
else
|
|
69
70
|
obj
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
<%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
|
|
14
14
|
</script>
|
|
15
15
|
|
|
16
|
-
<div class="<%= classes %>" data-module="track-click">
|
|
16
|
+
<div class="<%= classes %>" data-module="gem-track-click">
|
|
17
17
|
<ol class="govuk-breadcrumbs__list">
|
|
18
18
|
<% breadcrumbs.each_with_index do |crumb, index| %>
|
|
19
19
|
<% breadcrumb = GovukPublishingComponents::Presenters::Breadcrumb.new(crumb, index) %>
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
text = raw(text)
|
|
15
15
|
|
|
16
16
|
cookie_preferences_href ||= "/help/cookies"
|
|
17
|
-
confirmation_message ||= raw("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.")
|
|
17
|
+
confirmation_message ||= raw("You can <a class='govuk-link' href='#{cookie_preferences_href}' data-module='gem-track-click' data-track-category='cookieBanner' data-track-action='Cookie banner settings clicked from confirmation'>change your cookie settings</a> at any time.")
|
|
18
18
|
services_cookies ||= nil
|
|
19
19
|
css_classes = %w(gem-c-cookie-banner govuk-clearfix)
|
|
20
20
|
css_classes << "gem-c-cookie-banner--services" if services_cookies
|
|
@@ -35,12 +35,12 @@
|
|
|
35
35
|
<%= render "govuk_publishing_components/components/button", {
|
|
36
36
|
name: "cookies",
|
|
37
37
|
text: services_cookies.dig(:yes, :text) || "Yes",
|
|
38
|
-
data_attributes: { module: "track-click", "accept-cookies": "true", }.merge(services_cookies.dig(:yes, :data_attributes) || {})
|
|
38
|
+
data_attributes: { module: "gem-track-click", "accept-cookies": "true", }.merge(services_cookies.dig(:yes, :data_attributes) || {})
|
|
39
39
|
} %>
|
|
40
40
|
<%= render "govuk_publishing_components/components/button", {
|
|
41
41
|
name: "cookies",
|
|
42
42
|
text: services_cookies.dig(:no, :text) || "No",
|
|
43
|
-
data_attributes: { module: "track-click", "reject-cookies": "true", }.merge(services_cookies.dig(:no, :data_attributes) || {})
|
|
43
|
+
data_attributes: { module: "gem-track-click", "reject-cookies": "true", }.merge(services_cookies.dig(:no, :data_attributes) || {})
|
|
44
44
|
} %>
|
|
45
45
|
<% if services_cookies[:cookie_preferences] %>
|
|
46
46
|
<%= link_to services_cookies.dig(:cookie_preferences, :text), services_cookies.dig(:cookie_preferences, :href), class: "govuk-link" %>
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
name: "cookies",
|
|
53
53
|
text: "Accept additional cookies",
|
|
54
54
|
data_attributes: {
|
|
55
|
-
module: "track-click",
|
|
55
|
+
module: "gem-track-click",
|
|
56
56
|
"accept-cookies": "true",
|
|
57
57
|
"track-category": "cookieBanner",
|
|
58
58
|
"track-action": "Cookie banner accepted",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
name: "cookies",
|
|
64
64
|
text: "Reject additional cookies",
|
|
65
65
|
data_attributes: {
|
|
66
|
-
module: "track-click",
|
|
66
|
+
module: "gem-track-click",
|
|
67
67
|
"reject-cookies": "true",
|
|
68
68
|
"track-category": "cookieBanner",
|
|
69
69
|
"track-action": "Cookie banner rejected",
|
|
@@ -77,7 +77,7 @@
|
|
|
77
77
|
<div class="gem-c-cookie-banner__confirmation govuk-width-container" tabindex="-1" hidden>
|
|
78
78
|
<p class="gem-c-cookie-banner__confirmation-message" role="alert"><%= confirmation_message %></p>
|
|
79
79
|
<div class="govuk-button-group">
|
|
80
|
-
<button class="gem-c-cookie-banner__hide-button govuk-button" data-hide-cookie-banner="true" data-module="track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner">Hide this message</button>
|
|
80
|
+
<button class="gem-c-cookie-banner__hide-button govuk-button" data-hide-cookie-banner="true" data-module="gem-track-click" data-track-category="cookieBanner" data-track-action="Hide cookie banner">Hide this message</button>
|
|
81
81
|
</div>
|
|
82
82
|
</div>
|
|
83
83
|
</div>
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
%>
|
|
10
10
|
<% if items.any? %>
|
|
11
11
|
<% unless within_multitype_list %>
|
|
12
|
-
<ol class="gem-c-highlight-boxes" <%= "data-module=track-click" if highlight_boxes_helper.data_tracking? %>>
|
|
12
|
+
<ol class="gem-c-highlight-boxes" <%= "data-module=gem-track-click" if highlight_boxes_helper.data_tracking? %>>
|
|
13
13
|
<% end %>
|
|
14
14
|
<% items.each do |content_item| %>
|
|
15
15
|
<li class="gem-c-highlight-boxes__item-wrapper <%= half_width_class %>">
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
%>
|
|
10
10
|
<% if card_helper.href || card_helper.extra_links.any? %>
|
|
11
11
|
<div class="<%= classes %> <%= brand_helper.brand_class %>"
|
|
12
|
-
<%= "data-module=track-click" if card_helper.is_tracking? %>
|
|
12
|
+
<%= "data-module=gem-track-click" if card_helper.is_tracking? %>
|
|
13
13
|
<%= "lang=#{card_helper.lang}" if card_helper.lang %>>
|
|
14
14
|
<div class="gem-c-image-card__text-wrapper">
|
|
15
15
|
<div class="gem-c-image-card__header-and-context-wrapper">
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
classes << "gem-c-metadata--inverse" if inverse
|
|
17
17
|
%>
|
|
18
18
|
<%= content_tag :div, class: classes, data: { module: "gem-toggle" } do %>
|
|
19
|
-
<dl data-module="track-click">
|
|
19
|
+
<dl data-module="gem-track-click">
|
|
20
20
|
<% if from.any? %>
|
|
21
21
|
<dt class="gem-c-metadata__term"><%= t("govuk_component.metadata.from", default: "From") %>:</dt>
|
|
22
22
|
<dd class="gem-c-metadata__definition">
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
%>
|
|
27
27
|
<<%= wrapping_element %>
|
|
28
28
|
class="<%= wrapper_classes.join(" ") %>"
|
|
29
|
-
<%= "data-module=track-click" if organisation[:data_attributes] %>
|
|
29
|
+
<%= "data-module=gem-track-click" if organisation[:data_attributes] %>
|
|
30
30
|
>
|
|
31
31
|
<% if organisation[:url] %>
|
|
32
32
|
<%= link_to organisation[:url],
|
data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
role="navigation"
|
|
5
5
|
aria-label="<%= t("govuk_component.previous_and_next_navigation.pagination", default: "Pagination") %>"
|
|
6
6
|
>
|
|
7
|
-
<ul class="gem-c-pagination__list" data-module="track-click">
|
|
7
|
+
<ul class="gem-c-pagination__list" data-module="gem-track-click">
|
|
8
8
|
<% if local_assigns.include?(:previous_page) %>
|
|
9
9
|
<li class="gem-c-pagination__item gem-c-pagination__item--previous">
|
|
10
10
|
<a href="<%= previous_page[:url] %>"
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
<%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
|
|
29
29
|
</script>
|
|
30
30
|
|
|
31
|
-
<h2 class="<%= classes %>" data-module="track-click">
|
|
31
|
+
<h2 class="<%= classes %>" data-module="gem-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 %>"
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
<% if links.any? %>
|
|
7
7
|
<div
|
|
8
8
|
class="gem-c-step-nav-related <%= "gem-c-step-nav-related--singular" if links.length == 1 %>"
|
|
9
|
-
data-module="track-click">
|
|
9
|
+
data-module="gem-track-click">
|
|
10
10
|
<h2 class="gem-c-step-nav-related__heading">
|
|
11
11
|
<span class="gem-c-step-nav-related__pretitle"><%= pretitle %></span>
|
|
12
12
|
<% if links.length == 1 && !always_display_as_list %>
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
<% end %>
|
|
28
28
|
<ul
|
|
29
29
|
class="gem-c-subscription-links__list<%= ' gem-c-subscription-links__list--small' if local_assigns[:small_form] == true %>"
|
|
30
|
-
<%= "data-module=track-click" if sl_helper.tracking_is_present? %>
|
|
30
|
+
<%= "data-module=gem-track-click" if sl_helper.tracking_is_present? %>
|
|
31
31
|
>
|
|
32
32
|
<% if sl_helper.email_signup_link.present? %>
|
|
33
33
|
<li class="gem-c-subscription-links__list-item<%= ' gem-c-subscription-links__list-item--small' if local_assigns[:small_form] == true %>" >
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
taxonomy_list_helper = GovukPublishingComponents::Presenters::TaxonomyListHelper.new(image_cards)
|
|
10
10
|
%>
|
|
11
11
|
<% if highlight_box || document_list || image_cards %>
|
|
12
|
-
<ul class="gem-c-taxonomy-list" data-module="track-click">
|
|
12
|
+
<ul class="gem-c-taxonomy-list" data-module="gem-track-click">
|
|
13
13
|
<% if image_cards %>
|
|
14
14
|
<% taxonomy_list_helper.image_card_data.each do |image_card| %>
|
|
15
15
|
<li class="gem-c-taxonomy-list__item">
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
<nav role="navigation"
|
|
8
8
|
class="gem-c-translation-nav <%= translation_helper.classes %> <%= brand_helper.brand_class %>"
|
|
9
9
|
aria-label="<%= t("common.translations") %>"
|
|
10
|
-
<%= "data-module=\"track-click\"" if translation_helper.tracking_is_present? %>
|
|
10
|
+
<%= "data-module=\"gem-track-click\"" if translation_helper.tracking_is_present? %>
|
|
11
11
|
>
|
|
12
12
|
<ul class="gem-c-translation-nav__list">
|
|
13
13
|
<% translation_helper.translations.each.with_index do |translation, i| %>
|
|
@@ -45,7 +45,7 @@ examples:
|
|
|
45
45
|
data:
|
|
46
46
|
padding_top: false
|
|
47
47
|
block: |
|
|
48
|
-
<div class="gem-c-breadcrumbs " data-module="track-click">
|
|
48
|
+
<div class="gem-c-breadcrumbs " data-module="gem-track-click">
|
|
49
49
|
<ol>
|
|
50
50
|
<li class="">
|
|
51
51
|
<a data-track-category="breadcrumbClicked" data-track-action="1" data-track-label="/section" data-track-options="{"dimension28":"2","dimension29":"Section"}" class="gem-c-breadcrumbs--inverse" aria-current="false" href="/section">Section</a>
|
data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
<% navigation_aria_label ||= "Top level" %>
|
|
2
|
+
|
|
1
3
|
<% if navigation_items.any? %>
|
|
2
4
|
<button role="button" class="govuk-header__menu-button gem-c-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button>
|
|
3
5
|
<%= tag.nav class: "gem-c-header__nav", aria: { label: navigation_aria_label } do %>
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
%>
|
|
17
17
|
<% end %>
|
|
18
18
|
|
|
19
|
-
<ul class="gem-c-related-navigation__link-list" data-module="track-click">
|
|
19
|
+
<ul class="gem-c-related-navigation__link-list" data-module="gem-track-click">
|
|
20
20
|
<% constructed_link_array = [] %>
|
|
21
21
|
|
|
22
22
|
<% section_link_limit = related_nav_helper.calculate_section_link_limit(links) %>
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
link_element = link_to(
|
|
27
27
|
link[:text],
|
|
28
28
|
link[:path],
|
|
29
|
-
class: related_nav_helper.section_css_class("gem-c-related-navigation__section-link", section_title, link, (index >= section_link_limit)),
|
|
29
|
+
class: related_nav_helper.section_css_class("gem-c-related-navigation__section-link", section_title, link: link, link_is_inline: (index >= section_link_limit)),
|
|
30
30
|
rel: link[:rel],
|
|
31
31
|
lang: shared_helper.t_locale_check(link[:locale]),
|
|
32
32
|
data: {
|
|
@@ -15,6 +15,7 @@ module GovukPublishingComponents
|
|
|
15
15
|
yield(builder)
|
|
16
16
|
end
|
|
17
17
|
end
|
|
18
|
+
|
|
18
19
|
class TableBuilder
|
|
19
20
|
include ActionView::Helpers::UrlHelper
|
|
20
21
|
include ActionView::Helpers::TagHelper
|
|
@@ -57,7 +58,7 @@ module GovukPublishingComponents
|
|
|
57
58
|
|
|
58
59
|
def cell(str, opt = {})
|
|
59
60
|
classes = %w[govuk-table__cell]
|
|
60
|
-
classes << "govuk-table__cell
|
|
61
|
+
classes << "govuk-table__cell--#{opt[:format]}" if opt[:format]
|
|
61
62
|
classes << "govuk-table__cell--empty" unless str
|
|
62
63
|
str ||= "Not set"
|
|
63
64
|
tag.td str, class: classes
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
module GovukPublishingComponents
|
|
2
2
|
module Presenters
|
|
3
3
|
class HtmlPublicationSchema < FaqPageSchema
|
|
4
|
-
attr_reader :page
|
|
5
|
-
|
|
6
|
-
def initialize(page)
|
|
7
|
-
@page = page
|
|
8
|
-
end
|
|
9
|
-
|
|
10
4
|
def structured_data
|
|
11
5
|
return ArticleSchema.new(page).structured_data if less_than_two_headings_of_any_one_type?
|
|
12
6
|
|
|
@@ -55,7 +49,7 @@ module GovukPublishingComponents
|
|
|
55
49
|
# {:a => :b, :b => :c}
|
|
56
50
|
def pairs_hash(array)
|
|
57
51
|
all_but_last = array[0..-2]
|
|
58
|
-
all_but_first = array[1
|
|
52
|
+
all_but_first = array[1..]
|
|
59
53
|
pairs = [all_but_last, all_but_first].transpose
|
|
60
54
|
Hash[pairs]
|
|
61
55
|
end
|
|
@@ -20,8 +20,7 @@ module GovukPublishingComponents
|
|
|
20
20
|
meta_tags = add_organisation_tags(meta_tags)
|
|
21
21
|
meta_tags = add_political_tags(meta_tags)
|
|
22
22
|
meta_tags = add_taxonomy_tags(meta_tags)
|
|
23
|
-
|
|
24
|
-
meta_tags
|
|
23
|
+
add_step_by_step_tags(meta_tags)
|
|
25
24
|
end
|
|
26
25
|
|
|
27
26
|
private
|
|
@@ -58,14 +58,14 @@ module GovukPublishingComponents
|
|
|
58
58
|
I18n.t(
|
|
59
59
|
"components.related_#{@context}_navigation." + section_title,
|
|
60
60
|
default: [
|
|
61
|
-
I18n.t("components.related_navigation
|
|
61
|
+
I18n.t("components.related_navigation.#{section_title}"),
|
|
62
62
|
section_title.tr("_", " "),
|
|
63
63
|
],
|
|
64
64
|
)
|
|
65
65
|
end
|
|
66
66
|
end
|
|
67
67
|
|
|
68
|
-
def section_css_class(css_class, section_title, link
|
|
68
|
+
def section_css_class(css_class, section_title, link: {}, link_is_inline: false)
|
|
69
69
|
css_classes = [css_class]
|
|
70
70
|
css_classes << "#{css_class}--#{@context}" unless @context.nil?
|
|
71
71
|
css_classes << "#{css_class}--inline" if link_is_inline
|
|
@@ -14,7 +14,7 @@ namespace :component do
|
|
|
14
14
|
|
|
15
15
|
if components_missing_docs.any?
|
|
16
16
|
error = "You have components which are missing documentation. These components will not be displayed in the component guide:\n"
|
|
17
|
-
components_missing_docs.each { |component| error += "\t
|
|
17
|
+
components_missing_docs.each { |component| error += "\t#{component}\n" }
|
|
18
18
|
error += "\n"
|
|
19
19
|
raise NotImplementedError, error
|
|
20
20
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: govuk_publishing_components
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 24.3.
|
|
4
|
+
version: 24.3.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- GOV.UK Dev
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2021-02-
|
|
11
|
+
date: 2021-02-25 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: govuk_app_config
|
|
@@ -238,16 +238,16 @@ dependencies:
|
|
|
238
238
|
name: rubocop-govuk
|
|
239
239
|
requirement: !ruby/object:Gem::Requirement
|
|
240
240
|
requirements:
|
|
241
|
-
- -
|
|
241
|
+
- - '='
|
|
242
242
|
- !ruby/object:Gem::Version
|
|
243
|
-
version:
|
|
243
|
+
version: 4.0.0.pre.1
|
|
244
244
|
type: :development
|
|
245
245
|
prerelease: false
|
|
246
246
|
version_requirements: !ruby/object:Gem::Requirement
|
|
247
247
|
requirements:
|
|
248
|
-
- -
|
|
248
|
+
- - '='
|
|
249
249
|
- !ruby/object:Gem::Version
|
|
250
|
-
version:
|
|
250
|
+
version: 4.0.0.pre.1
|
|
251
251
|
- !ruby/object:Gem::Dependency
|
|
252
252
|
name: sassc-rails
|
|
253
253
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -1860,7 +1860,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
1860
1860
|
requirements:
|
|
1861
1861
|
- - ">="
|
|
1862
1862
|
- !ruby/object:Gem::Version
|
|
1863
|
-
version: '
|
|
1863
|
+
version: '2.6'
|
|
1864
1864
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
1865
1865
|
requirements:
|
|
1866
1866
|
- - ">="
|