govuk_publishing_components 34.12.0 → 34.14.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/config/govuk_publishing_components_manifest.js +75 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-auto-tracker.js +4 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +31 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-link-tracker.js +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/_individual_component_support.scss +10 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_action-link.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_attachment.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_back-link.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_big-number.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_button.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_cards.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_character-count.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_checkboxes.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_contents-list.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-guidance.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_date-input.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_details.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_devolved-nations.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_document-list.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_emergency-banner.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-alert.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-message.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_error-summary.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_fieldset.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_file-upload.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak-html-publication.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_heading.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_hint.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_inset-text.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_intervention.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_inverse-header.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_label.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_lead-paragraph.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_modal-dialogue.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_organisation-logo.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_panel.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_phase-banner.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_previous-and-next-navigation.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_print-link.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_related-navigation.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_select.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_share-links.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_show-password.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_signup-link.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_single-page-notification-button.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_skip-link.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-header.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav-related.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_success-alert.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_summary-list.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_table.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_tabs.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_textarea.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_title.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_translation-nav.scss +2 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_warning-text.scss +1 -0
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_action_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_attachment.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_attachment_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_back_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_big_number.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_button.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_cards.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_character_count.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_checkboxes.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_contents_list.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_contextual_breadcrumbs.html.erb +7 -4
- data/app/views/govuk_publishing_components/components/_contextual_guidance.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +5 -2
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_date_input.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_details.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_devolved_nations.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_document_list.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_emergency_banner.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_error_alert.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_error_message.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_error_summary.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_feedback.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_fieldset.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_file_upload.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_govspeak.html.erb +1 -0
- data/app/views/govuk_publishing_components/components/_govspeak_html_publication.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_heading.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_hint.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +5 -3
- data/app/views/govuk_publishing_components/components/_input.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_inset_text.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_intervention.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_inverse_header.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_label.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +5 -1
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_lead_paragraph.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_modal_dialogue.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_notice.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_organisation_logo.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_panel.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_phase_banner.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb +6 -1
- data/app/views/govuk_publishing_components/components/_print_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_radio.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +4 -0
- data/app/views/govuk_publishing_components/components/_reorderable_list.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_search.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_select.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_show_password.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_signup_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_skip_link.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_header.html.erb +12 -2
- data/app/views/govuk_publishing_components/components/_step_by_step_nav_related.html.erb +21 -8
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_success_alert.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_summary_list.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_table.html.erb +3 -1
- data/app/views/govuk_publishing_components/components/_tabs.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_textarea.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_title.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_translation_nav.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_warning_text.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/docs/contextual_breadcrumbs.yml +13 -0
- data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +11 -0
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_header.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/step_by_step_nav_related.yml +10 -0
- data/lib/govuk_publishing_components/app_helpers/asset_helper.rb +86 -0
- data/lib/govuk_publishing_components/config.rb +3 -0
- data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +3 -2
- data/lib/govuk_publishing_components/presenters/breadcrumbs.rb +3 -1
- data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +2 -1
- data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +1 -1
- data/lib/govuk_publishing_components/railtie.rb +7 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/lib/govuk_publishing_components.rb +3 -0
- metadata +5 -2
@@ -1,4 +1,6 @@
|
|
1
1
|
<%
|
2
|
+
add_gem_component_stylesheet("big-number")
|
3
|
+
|
2
4
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
3
5
|
big_number_helper = GovukPublishingComponents::Presenters::BigNumberHelper.new(local_assigns)
|
4
6
|
|
@@ -34,7 +36,7 @@
|
|
34
36
|
</span>
|
35
37
|
<% end %>
|
36
38
|
<% end %>
|
37
|
-
|
39
|
+
|
38
40
|
<%= tag.div class: classes, aria: aria do %>
|
39
41
|
<% unless href.nil? %>
|
40
42
|
<%= link_to big_number_value, href, class: "govuk-link gem-c-big-number__link", data: data_attributes %>
|
@@ -1,7 +1,10 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<%
|
2
|
+
ga4_tracking ||= false
|
3
|
+
prioritise_taxon_breadcrumbs ||= false
|
4
|
+
breadcrumb_selector = GovukPublishingComponents::Presenters::BreadcrumbSelector.new(content_item, request, prioritise_taxon_breadcrumbs, ga4_tracking)
|
5
|
+
inverse ||= false
|
6
|
+
collapse_on_mobile ||= true unless local_assigns[:collapse_on_mobile].eql?(false)
|
7
|
+
%>
|
5
8
|
|
6
9
|
<div class="gem-c-contextual-breadcrumbs">
|
7
10
|
<% if breadcrumb_selector.step_by_step %>
|
@@ -1,4 +1,6 @@
|
|
1
1
|
<%
|
2
|
+
add_gem_component_stylesheet("contextual-sidebar")
|
3
|
+
|
2
4
|
ga4_tracking ||= false
|
3
5
|
request.query_parameters[:ga4_tracking] = ga4_tracking
|
4
6
|
navigation = GovukPublishingComponents::Presenters::ContextualNavigation.new(content_item, request)
|
@@ -8,7 +10,7 @@
|
|
8
10
|
<div class="gem-c-contextual-sidebar">
|
9
11
|
<% if navigation.content_tagged_to_a_reasonable_number_of_step_by_steps? %>
|
10
12
|
<%# Rendering step by step related items because there are a few but not too many of them %>
|
11
|
-
<%= render 'govuk_publishing_components/components/step_by_step_nav_related', links: navigation.step_nav_helper.related_links %>
|
13
|
+
<%= render 'govuk_publishing_components/components/step_by_step_nav_related', links: navigation.step_nav_helper.related_links, ga4_tracking: ga4_tracking %>
|
12
14
|
<% end %>
|
13
15
|
|
14
16
|
<% if navigation.content_tagged_to_current_step_by_step? %>
|
@@ -24,7 +26,8 @@
|
|
24
26
|
<%= render 'govuk_publishing_components/components/step_by_step_nav_related', {
|
25
27
|
pretitle: t("components.contextual_sidebar.pretitle"),
|
26
28
|
links: navigation.step_nav_helper.also_part_of_step_nav,
|
27
|
-
always_display_as_list: true
|
29
|
+
always_display_as_list: true,
|
30
|
+
ga4_tracking: ga4_tracking
|
28
31
|
} %>
|
29
32
|
<% end %>
|
30
33
|
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<%
|
2
|
+
add_gem_component_stylesheet("govspeak")
|
2
3
|
inverse ||= false
|
3
4
|
direction_class = "direction-#{direction}" if local_assigns.include?(:direction)
|
4
5
|
disable_youtube_expansions = local_assigns.fetch(:disable_youtube_expansions) if local_assigns.include?(:disable_youtube_expansions)
|
@@ -1,4 +1,6 @@
|
|
1
1
|
<%
|
2
|
+
add_gem_component_stylesheet("govspeak-html-publication")
|
3
|
+
|
2
4
|
govspeak_locals = {}
|
3
5
|
govspeak_locals[:content] = local_assigns.fetch(:content) if local_assigns.include?(:content)
|
4
6
|
govspeak_locals[:direction] = local_assigns.fetch(:direction) if local_assigns.include?(:direction)
|
@@ -1,4 +1,6 @@
|
|
1
1
|
<%
|
2
|
+
add_gem_component_stylesheet("image-card")
|
3
|
+
|
2
4
|
sizes ||= false
|
3
5
|
brand ||= false
|
4
6
|
|
@@ -17,7 +19,7 @@
|
|
17
19
|
heading_link_classes = %w[
|
18
20
|
gem-c-image-card__title-link
|
19
21
|
govuk-link
|
20
|
-
]
|
22
|
+
]
|
21
23
|
heading_link_classes << brand_helper.color_class
|
22
24
|
extra_link_classes = %w[
|
23
25
|
gem-c-image-card__list-item-link
|
@@ -59,8 +61,8 @@
|
|
59
61
|
%>
|
60
62
|
<% else %>
|
61
63
|
<%= link[:text] %>
|
62
|
-
<% end %>
|
63
|
-
</li>
|
64
|
+
<% end %>
|
65
|
+
</li>
|
64
66
|
<% end %>
|
65
67
|
</ul>
|
66
68
|
<% end %>
|
data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb
CHANGED
@@ -1,4 +1,9 @@
|
|
1
|
-
<%
|
1
|
+
<%
|
2
|
+
add_gem_component_stylesheet("previous-and-next-navigation")
|
3
|
+
|
4
|
+
if local_assigns.include?(:next_page) || local_assigns.include?(:previous_page)
|
5
|
+
%>
|
6
|
+
|
2
7
|
<nav
|
3
8
|
class="govuk-pagination govuk-pagination--block"
|
4
9
|
role="navigation"
|
@@ -7,6 +7,10 @@
|
|
7
7
|
data[:module] << " ga4-link-tracker" if ga4_tracking
|
8
8
|
%>
|
9
9
|
|
10
|
+
<%
|
11
|
+
add_gem_component_stylesheet("related-navigation")
|
12
|
+
%>
|
13
|
+
|
10
14
|
<% if related_nav_helper.related_navigation? %>
|
11
15
|
<% random = SecureRandom.hex(4) %>
|
12
16
|
<%= tag.div(class: "gem-c-related-navigation", data: data) do %>
|
data/app/views/govuk_publishing_components/components/_single_page_notification_button.html.erb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
<%
|
2
|
+
add_gem_component_stylesheet("single-page-notification-button")
|
3
|
+
|
2
4
|
component_helper = GovukPublishingComponents::Presenters::SinglePageNotificationButtonHelper.new(local_assigns)
|
3
5
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
4
6
|
|
@@ -1,12 +1,19 @@
|
|
1
1
|
<%
|
2
|
+
add_gem_component_stylesheet("step-by-step-nav-header")
|
3
|
+
|
2
4
|
title ||= false
|
3
5
|
path ||= false
|
6
|
+
ga4_tracking ||= false
|
4
7
|
breadcrumbs = [
|
5
8
|
{ title: "Home", url: "/" },
|
6
9
|
{ title: title, url: path }
|
7
10
|
]
|
8
11
|
breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)
|
9
12
|
|
13
|
+
data = {}
|
14
|
+
data[:module] = "gem-track-click"
|
15
|
+
data[:module] << " ga4-link-tracker" if ga4_tracking
|
16
|
+
|
10
17
|
tracking_id ||= false
|
11
18
|
tracking_category ||= "stepNavHeaderClicked"
|
12
19
|
tracking_action ||= "top"
|
@@ -20,7 +27,7 @@
|
|
20
27
|
end
|
21
28
|
|
22
29
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
23
|
-
classes = %w
|
30
|
+
classes = %w[gem-c-step-nav-header]
|
24
31
|
classes << shared_helper.get_margin_bottom if local_assigns[:margin_bottom]
|
25
32
|
%>
|
26
33
|
<% if title %>
|
@@ -28,7 +35,7 @@
|
|
28
35
|
<%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
|
29
36
|
</script>
|
30
37
|
|
31
|
-
<%= tag.div
|
38
|
+
<%= tag.div(class: classes, data: data) do %>
|
32
39
|
<strong class="gem-c-step-nav-header__part-of">Part of</strong>
|
33
40
|
<% if path %>
|
34
41
|
<a href="<%= path %>"
|
@@ -36,6 +43,9 @@
|
|
36
43
|
data-track-category="<%= tracking_category %>"
|
37
44
|
data-track-action="<%= tracking_action %>"
|
38
45
|
data-track-label="<%= tracking_label %>"
|
46
|
+
<% if ga4_tracking %>
|
47
|
+
data-ga4-link='{"event_name":"navigation", "type":"super breadcrumb", "index":{"index_link": "1"}, "index_total":"1"}'
|
48
|
+
<% end %>
|
39
49
|
<% if tracking_dimension_enabled %>
|
40
50
|
data-track-dimension="<%= tracking_dimension %>"
|
41
51
|
data-track-dimension-index="<%= tracking_dimension_index %>"
|