govuk_publishing_components 34.0.0 → 34.5.0
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/images/govuk_publishing_components/icon-search.svg +3 -0
- data/app/assets/images/govuk_publishing_components/youtube-play-icon.png +0 -0
- data/app/assets/images/govuk_publishing_components/youtube-play-icon.svg +4 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics/auto-scroll-tracker.js +2 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics/linked-domains.js +135 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-core.js +1 -40
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-event-tracker.js +2 -0
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/ga4-page-views.js +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4.js +0 -1
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +2 -2
- data/app/assets/javascripts/govuk_publishing_components/components/image-card.js +19 -0
- data/app/assets/javascripts/govuk_publishing_components/components/layout-super-navigation-header.js +12 -69
- data/app/assets/javascripts/govuk_publishing_components/components/step-by-step-nav.js +14 -13
- data/app/assets/javascripts/govuk_publishing_components/dependencies.js +3 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/govspeak/youtube-link-enhancement.js +3 -2
- data/app/assets/javascripts/govuk_publishing_components/load-analytics.js +209 -0
- data/app/assets/javascripts/govuk_publishing_components/modules.js +7 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_feedback.scss +15 -19
- data/app/assets/stylesheets/govuk_publishing_components/components/_image-card.scss +82 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_input.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_layout-super-navigation-header.scss +247 -412
- data/app/assets/stylesheets/govuk_publishing_components/components/_subscription-links.scss +0 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +26 -9
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_brand-colours.scss +2 -2
- data/app/controllers/govuk_publishing_components/application_controller.rb +0 -13
- data/app/controllers/govuk_publishing_components/audit_controller.rb +1 -1
- data/app/models/govuk_publishing_components/audit_comparer.rb +1 -1
- data/app/models/govuk_publishing_components/audit_components.rb +103 -82
- data/app/views/govuk_publishing_components/audit/_applications.html.erb +1 -1
- data/app/views/govuk_publishing_components/audit/_component_contents.html.erb +47 -39
- data/app/views/govuk_publishing_components/audit/_components.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_contextual_footer.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_contextual_sidebar.html.erb +7 -3
- data/app/views/govuk_publishing_components/components/_cookie_banner.html.erb +10 -6
- data/app/views/govuk_publishing_components/components/_error_message.html.erb +2 -1
- data/app/views/govuk_publishing_components/components/_google_tag_manager_script.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_hint.html.erb +2 -1
- data/app/views/govuk_publishing_components/components/_image_card.html.erb +12 -9
- data/app/views/govuk_publishing_components/components/_input.html.erb +8 -2
- data/app/views/govuk_publishing_components/components/_label.html.erb +5 -3
- data/app/views/govuk_publishing_components/components/_layout_for_admin.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +6 -2
- data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb +125 -145
- data/app/views/govuk_publishing_components/components/_related_navigation.html.erb +12 -6
- data/app/views/govuk_publishing_components/components/_subscription_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_textarea.html.erb +10 -2
- data/app/views/govuk_publishing_components/components/docs/contextual_footer.yml +43 -0
- data/app/views/govuk_publishing_components/components/docs/contextual_sidebar.yml +58 -0
- data/app/views/govuk_publishing_components/components/docs/emergency_banner.yml +3 -1
- data/app/views/govuk_publishing_components/components/docs/error_message.yml +13 -0
- data/app/views/govuk_publishing_components/components/docs/hint.yml +6 -0
- data/app/views/govuk_publishing_components/components/docs/image_card.yml +24 -1
- data/app/views/govuk_publishing_components/components/docs/input.yml +32 -0
- data/app/views/govuk_publishing_components/components/docs/intervention.yml +2 -1
- data/app/views/govuk_publishing_components/components/docs/label.yml +17 -0
- data/app/views/govuk_publishing_components/components/docs/layout_header.yml +1 -0
- data/app/views/govuk_publishing_components/components/docs/previous_and_next_navigation.yml +2 -0
- data/app/views/govuk_publishing_components/components/docs/related_navigation.yml +27 -0
- data/app/views/govuk_publishing_components/components/docs/textarea.yml +31 -0
- data/app/views/govuk_publishing_components/components/docs/translation_nav.yml +2 -0
- data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +1 -2
- data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +4 -2
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +18 -8
- data/app/views/layouts/govuk_publishing_components/application.html.erb +2 -2
- data/config/locales/ar.yml +14 -7
- data/config/locales/az.yml +14 -7
- data/config/locales/be.yml +14 -7
- data/config/locales/bg.yml +14 -7
- data/config/locales/bn.yml +14 -7
- data/config/locales/cs.yml +14 -7
- data/config/locales/cy.yml +14 -7
- data/config/locales/da.yml +14 -7
- data/config/locales/de.yml +14 -7
- data/config/locales/dr.yml +14 -7
- data/config/locales/el.yml +14 -7
- data/config/locales/en.yml +18 -18
- data/config/locales/es-419.yml +14 -7
- data/config/locales/es.yml +14 -7
- data/config/locales/et.yml +14 -7
- data/config/locales/fa.yml +14 -7
- data/config/locales/fi.yml +14 -7
- data/config/locales/fr.yml +14 -7
- data/config/locales/gd.yml +14 -7
- data/config/locales/gu.yml +14 -7
- data/config/locales/he.yml +14 -7
- data/config/locales/hi.yml +14 -7
- data/config/locales/hr.yml +14 -7
- data/config/locales/hu.yml +14 -7
- data/config/locales/hy.yml +14 -7
- data/config/locales/id.yml +14 -7
- data/config/locales/is.yml +14 -7
- data/config/locales/it.yml +14 -7
- data/config/locales/ja.yml +14 -7
- data/config/locales/ka.yml +14 -7
- data/config/locales/kk.yml +14 -7
- data/config/locales/ko.yml +14 -7
- data/config/locales/lt.yml +14 -7
- data/config/locales/lv.yml +14 -7
- data/config/locales/ms.yml +14 -7
- data/config/locales/mt.yml +14 -7
- data/config/locales/nl.yml +14 -7
- data/config/locales/no.yml +14 -7
- data/config/locales/pa-pk.yml +14 -7
- data/config/locales/pa.yml +14 -7
- data/config/locales/pl.yml +14 -7
- data/config/locales/ps.yml +14 -7
- data/config/locales/pt.yml +14 -7
- data/config/locales/ro.yml +14 -7
- data/config/locales/ru.yml +14 -7
- data/config/locales/si.yml +14 -7
- data/config/locales/sk.yml +14 -7
- data/config/locales/sl.yml +14 -7
- data/config/locales/so.yml +14 -7
- data/config/locales/sq.yml +14 -7
- data/config/locales/sr.yml +14 -7
- data/config/locales/sv.yml +14 -7
- data/config/locales/sw.yml +14 -7
- data/config/locales/ta.yml +14 -7
- data/config/locales/th.yml +14 -7
- data/config/locales/tk.yml +14 -7
- data/config/locales/tr.yml +14 -7
- data/config/locales/uk.yml +14 -7
- data/config/locales/ur.yml +14 -7
- data/config/locales/uz.yml +14 -7
- data/config/locales/vi.yml +14 -7
- data/config/locales/zh-hk.yml +14 -7
- data/config/locales/zh-tw.yml +14 -7
- data/config/locales/zh.yml +14 -7
- data/lib/govuk_publishing_components/presenters/image_card_helper.rb +65 -2
- data/lib/govuk_publishing_components/presenters/page_with_step_by_step_navigation.rb +1 -1
- data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +4 -0
- data/lib/govuk_publishing_components/version.rb +1 -1
- data/node_modules/axe-core/README.md +1 -1
- data/node_modules/axe-core/axe.d.ts +76 -24
- data/node_modules/axe-core/axe.js +4903 -4648
- data/node_modules/axe-core/axe.min.js +3 -3
- data/node_modules/axe-core/package.json +28 -28
- data/node_modules/axe-core/sri-history.json +16 -0
- data/node_modules/govuk-frontend/govuk/helpers/_focused.scss +5 -0
- data/node_modules/govuk-frontend/package.json +1 -1
- metadata +9 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics-ga4/init-ga4.js +0 -28
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
<%
|
|
2
2
|
sizes ||= false
|
|
3
3
|
brand ||= false
|
|
4
|
+
|
|
4
5
|
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
|
5
|
-
card_helper = GovukPublishingComponents::Presenters::ImageCardHelper.new(local_assigns)
|
|
6
|
+
card_helper = GovukPublishingComponents::Presenters::ImageCardHelper.new(local_assigns, brand_helper)
|
|
6
7
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
7
|
-
classes =
|
|
8
|
-
classes << "
|
|
9
|
-
classes << "
|
|
8
|
+
classes = %w[gem-c-image-card]
|
|
9
|
+
classes << "gem-c-image-card--large" if card_helper.large
|
|
10
|
+
classes << "gem-c-image-card--no-image" unless (card_helper.image_src || card_helper.youtube_video_id)
|
|
11
|
+
classes << brand_helper.brand_class if brand_helper.brand_class
|
|
10
12
|
|
|
11
13
|
font_size ||= card_helper.large ? 'm' : 's'
|
|
12
14
|
heading_class = %w[gem-c-image-card__title]
|
|
@@ -23,11 +25,12 @@
|
|
|
23
25
|
]
|
|
24
26
|
extra_link_classes << brand_helper.color_class
|
|
25
27
|
|
|
28
|
+
data_modules = %w[]
|
|
29
|
+
data_modules << "gem-track-click ga4-link-tracker" if card_helper.is_tracking?
|
|
30
|
+
data_modules << "image-card" if card_helper.youtube_video_id
|
|
26
31
|
%>
|
|
27
32
|
<% if card_helper.href || card_helper.extra_details.any? %>
|
|
28
|
-
|
|
29
|
-
<%= "data-module=gem-track-click" if card_helper.is_tracking? %>
|
|
30
|
-
<%= "lang=#{card_helper.lang}" if card_helper.lang %>>
|
|
33
|
+
<%= content_tag(:div, class: classes, "data-module": data_modules, lang: card_helper.lang) do %>
|
|
31
34
|
<div class="gem-c-image-card__text-wrapper">
|
|
32
35
|
<div class="gem-c-image-card__header-and-context-wrapper">
|
|
33
36
|
<% if card_helper.heading_text %>
|
|
@@ -65,6 +68,6 @@
|
|
|
65
68
|
<p class="gem-c-image-card__metadata"><%= card_helper.metadata %></p>
|
|
66
69
|
<% end %>
|
|
67
70
|
</div>
|
|
68
|
-
<%= card_helper.
|
|
69
|
-
|
|
71
|
+
<%= card_helper.media %>
|
|
72
|
+
<% end %>
|
|
70
73
|
<% end %>
|
|
@@ -31,6 +31,8 @@
|
|
|
31
31
|
heading_level ||= nil
|
|
32
32
|
prefix ||= nil
|
|
33
33
|
suffix ||= nil
|
|
34
|
+
right_to_left ||= false
|
|
35
|
+
right_to_left_help = right_to_left_help.nil? ? right_to_left : right_to_left_help
|
|
34
36
|
|
|
35
37
|
css_classes = %w(gem-c-input govuk-input)
|
|
36
38
|
css_classes << "govuk-input--error" if has_error
|
|
@@ -70,7 +72,8 @@
|
|
|
70
72
|
<% label_markup = capture do %>
|
|
71
73
|
<%= render "govuk_publishing_components/components/label", {
|
|
72
74
|
html_for: id,
|
|
73
|
-
heading_size: heading_size
|
|
75
|
+
heading_size: heading_size,
|
|
76
|
+
right_to_left: right_to_left_help
|
|
74
77
|
}.merge(label.symbolize_keys) %>
|
|
75
78
|
<% end %>
|
|
76
79
|
|
|
@@ -86,7 +89,8 @@
|
|
|
86
89
|
<% if hint %>
|
|
87
90
|
<%= render "govuk_publishing_components/components/hint", {
|
|
88
91
|
id: hint_id,
|
|
89
|
-
text: hint
|
|
92
|
+
text: hint,
|
|
93
|
+
right_to_left: right_to_left_help
|
|
90
94
|
} %>
|
|
91
95
|
<% end %>
|
|
92
96
|
|
|
@@ -95,6 +99,7 @@
|
|
|
95
99
|
id: error_id,
|
|
96
100
|
text: error_message,
|
|
97
101
|
items: error_items,
|
|
102
|
+
right_to_left: right_to_left_help
|
|
98
103
|
} %>
|
|
99
104
|
<% end %>
|
|
100
105
|
|
|
@@ -107,6 +112,7 @@
|
|
|
107
112
|
autofocus: autofocus,
|
|
108
113
|
class: css_classes,
|
|
109
114
|
data: data,
|
|
115
|
+
dir: right_to_left ? "rtl" : nil,
|
|
110
116
|
enterkeyhint: checked_enterkeyhint,
|
|
111
117
|
id: id,
|
|
112
118
|
inputmode: inputmode,
|
|
@@ -2,10 +2,12 @@
|
|
|
2
2
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
3
3
|
|
|
4
4
|
hint_text ||= ""
|
|
5
|
+
id ||= nil
|
|
5
6
|
is_radio_label ||= false
|
|
6
7
|
bold ||= false
|
|
7
8
|
heading_size = false unless shared_helper.valid_heading_size?(heading_size)
|
|
8
9
|
is_page_heading ||= false
|
|
10
|
+
right_to_left ||= false
|
|
9
11
|
|
|
10
12
|
css_classes = %w[gem-c-label govuk-label]
|
|
11
13
|
css_classes << "govuk-label--s" if bold
|
|
@@ -18,14 +20,14 @@
|
|
|
18
20
|
|
|
19
21
|
<% if is_page_heading %>
|
|
20
22
|
<%= tag.h1 text, class: "govuk-label-wrapper" do %>
|
|
21
|
-
<%= tag.label text, for: html_for, class: css_classes %>
|
|
23
|
+
<%= tag.label text, id: id, for: html_for, class: css_classes, dir: right_to_left ? "rtl" : nil %>
|
|
22
24
|
<% end %>
|
|
23
25
|
<% else %>
|
|
24
|
-
<%= tag.label text, for: html_for, class: css_classes %>
|
|
26
|
+
<%= tag.label text, id: id, for: html_for, class: css_classes, dir: right_to_left ? "rtl" : nil %>
|
|
25
27
|
<% end %>
|
|
26
28
|
|
|
27
29
|
<% if hint_text.present? %>
|
|
28
|
-
<%= tag.
|
|
30
|
+
<%= tag.div id: hint_id, class: hint_text_css_classes, dir: right_to_left ? "rtl" : nil do %>
|
|
29
31
|
<%= hint_text %>
|
|
30
32
|
<% end %>
|
|
31
33
|
<% end %>
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
<%= yield :head %>
|
|
15
15
|
</head>
|
|
16
16
|
<body class="gem-c-layout-for-admin govuk-template__body">
|
|
17
|
-
|
|
17
|
+
<%= javascript_tag nonce: true do -%>
|
|
18
18
|
document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
|
|
19
|
-
|
|
19
|
+
<% end -%>
|
|
20
20
|
<%= yield %>
|
|
21
21
|
<%= javascript_include_tag "application" %>
|
|
22
22
|
</body>
|
|
@@ -59,6 +59,10 @@
|
|
|
59
59
|
}
|
|
60
60
|
} %>
|
|
61
61
|
|
|
62
|
+
<% # Used for Google Analytics 4 debugging. Must be placed before load-analytics script. %>
|
|
63
|
+
<meta name="govuk:components_gem_version" content="<%= GovukPublishingComponents::VERSION %>" />
|
|
64
|
+
<%= javascript_include_tag "govuk_publishing_components/load-analytics" %>
|
|
65
|
+
|
|
62
66
|
<%= csrf_meta_tags %>
|
|
63
67
|
|
|
64
68
|
<%= stylesheet_link_tag "application", media: "all" %>
|
|
@@ -81,9 +85,9 @@
|
|
|
81
85
|
<%= yield :head %>
|
|
82
86
|
</head>
|
|
83
87
|
<%= tag.body class: body_css_classes do %>
|
|
84
|
-
|
|
88
|
+
<%= javascript_tag nonce: true do -%>
|
|
85
89
|
document.body.className = ((document.body.className) ? document.body.className + ' js-enabled' : 'js-enabled');
|
|
86
|
-
|
|
90
|
+
<% end -%>
|
|
87
91
|
<%= render "govuk_publishing_components/components/skip_link", {
|
|
88
92
|
href: "#content"
|
|
89
93
|
} %>
|
data/app/views/govuk_publishing_components/components/_layout_super_navigation_header.html.erb
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
logo_link ||= "https://www.gov.uk/"
|
|
3
3
|
logo_link_title ||= t("components.layout_super_navigation_header.logo_link_title")
|
|
4
4
|
logo_text = t("components.layout_super_navigation_header.logo_text")
|
|
5
|
-
|
|
5
|
+
navigation_links_columns = t("components.layout_super_navigation_header.navigation_links_columns")
|
|
6
6
|
navigation_menu_heading = t("components.layout_super_navigation_header.navigation_menu_heading")
|
|
7
7
|
navigation_search_heading = t("components.layout_super_navigation_header.navigation_search_heading")
|
|
8
8
|
navigation_search_subheading = t("components.layout_super_navigation_header.navigation_search_subheading")
|
|
@@ -14,8 +14,14 @@
|
|
|
14
14
|
show_search_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "search")
|
|
15
15
|
hide_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.hide", :label => "navigation")
|
|
16
16
|
show_navigation_menu_text = t("components.layout_super_navigation_header.menu_toggle_label.show", :label => "navigation")
|
|
17
|
+
|
|
18
|
+
navigation_links_length = 1 # GOVUK Logo makes this start from 1
|
|
19
|
+
navigation_links_columns.each do | column |
|
|
20
|
+
navigation_links_length = navigation_links_length + column[:menu_contents].length
|
|
21
|
+
end
|
|
22
|
+
navigation_links_length = navigation_links_length + popular_links.length
|
|
17
23
|
%>
|
|
18
|
-
<header role="banner" class="gem-c-layout-super-navigation-header" data-module="gem-track-click ga4-event-tracker" data-track-links-only data-ga4-expandable>
|
|
24
|
+
<header role="banner" class="gem-c-layout-super-navigation-header" data-module="gem-track-click ga4-event-tracker ga4-link-tracker" data-track-links-only data-ga4-expandable>
|
|
19
25
|
<div class="gem-c-layout-super-navigation-header__container govuk-width-container govuk-clearfix">
|
|
20
26
|
<div class="gem-c-layout-super-navigation-header__header-logo">
|
|
21
27
|
<a
|
|
@@ -28,6 +34,15 @@
|
|
|
28
34
|
href="<%= logo_link %>"
|
|
29
35
|
id="logo"
|
|
30
36
|
title="<%= logo_link_title %>"
|
|
37
|
+
data-ga4-link="<%= {
|
|
38
|
+
"event_name": "navigation",
|
|
39
|
+
"type": "header menu bar",
|
|
40
|
+
"external": "false",
|
|
41
|
+
"text": "GOV.UK",
|
|
42
|
+
"section": "Logo",
|
|
43
|
+
"index": 0,
|
|
44
|
+
"index_total": navigation_links_length
|
|
45
|
+
}.to_json %>"
|
|
31
46
|
>
|
|
32
47
|
<span class="govuk-header__logotype">
|
|
33
48
|
<!--[if gt IE 8]><!-->
|
|
@@ -65,160 +80,118 @@
|
|
|
65
80
|
<h2 id="super-navigation-menu-heading" class="govuk-visually-hidden">
|
|
66
81
|
<%= navigation_menu_heading %>
|
|
67
82
|
</h2>
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
>
|
|
90
|
-
<span class="gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner">
|
|
91
|
-
Menu
|
|
83
|
+
|
|
84
|
+
<%
|
|
85
|
+
link = t("components.layout_super_navigation_header.navigation_link")
|
|
86
|
+
unique_id = SecureRandom.hex(4)
|
|
87
|
+
show_menu_text = show_navigation_menu_text
|
|
88
|
+
hide_menu_text = hide_navigation_menu_text
|
|
89
|
+
tracking_label = link[:label].downcase.gsub(/\s+/, "")
|
|
90
|
+
%>
|
|
91
|
+
|
|
92
|
+
<%= link_to link[:href], {
|
|
93
|
+
class: "gem-c-layout-super-navigation-header__navigation-item-link",
|
|
94
|
+
data: {
|
|
95
|
+
track_action: "#{tracking_label}Link",
|
|
96
|
+
track_category: "headerClicked",
|
|
97
|
+
track_label: link[:href],
|
|
98
|
+
track_dimension: link[:label],
|
|
99
|
+
track_dimension_index: "29",
|
|
100
|
+
}
|
|
101
|
+
} do %>
|
|
102
|
+
<span class="gem-c-layout-super-navigation-header__navigation-item-link-inner">
|
|
103
|
+
<%= link[:label] %>
|
|
92
104
|
</span>
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
id="super-navigation-menu__section-<%= unique_id %>"
|
|
157
|
-
>
|
|
158
|
-
<div class="govuk-width-container gem-c-layout-super-navigation-header__width-container">
|
|
159
|
-
<div class="govuk-grid-row">
|
|
160
|
-
<div class="govuk-grid-column-one-third-from-desktop">
|
|
161
|
-
<% if link[:description].present? %>
|
|
162
|
-
<h3 class="govuk-body-l gem-c-layout-super-navigation-header__menu-description">
|
|
163
|
-
<%= link[:description] %>
|
|
164
|
-
</h3>
|
|
165
|
-
<% end %>
|
|
166
|
-
</div>
|
|
167
|
-
<div class="govuk-grid-column-two-thirds-from-desktop">
|
|
168
|
-
<% if link[:menu_contents].present? %>
|
|
169
|
-
<ul class="gem-c-layout-super-navigation-header__navigation-second-items gem-c-layout-super-navigation-header__navigation-second-items--<%= link[:label].parameterize %>">
|
|
170
|
-
<% link[:menu_contents].each do | item | %>
|
|
171
|
-
<%
|
|
172
|
-
has_description = item[:description].present?
|
|
173
|
-
link_classes = %w[govuk-link gem-c-layout-super-navigation-header__navigation-second-item-link]
|
|
174
|
-
link_classes << "gem-c-layout-super-navigation-header__navigation-second-item-link--with-description" if has_description
|
|
175
|
-
%>
|
|
176
|
-
<li class="gem-c-layout-super-navigation-header__dropdown-list-item">
|
|
177
|
-
<%= link_to item[:label], item[:href], {
|
|
178
|
-
class: link_classes,
|
|
179
|
-
data: {
|
|
180
|
-
track_action: "#{tracking_label}Link",
|
|
181
|
-
track_category: "headerClicked",
|
|
182
|
-
track_label: item[:href],
|
|
183
|
-
track_dimension: item[:label],
|
|
184
|
-
track_dimension_index: "29",
|
|
185
|
-
}
|
|
186
|
-
} %>
|
|
187
|
-
<%= tag.p item[:description], class: "gem-c-layout-super-navigation-header__navigation-second-item-description" if has_description %>
|
|
188
|
-
</li>
|
|
189
|
-
<% end %>
|
|
190
|
-
</ul>
|
|
191
|
-
<% end %>
|
|
192
|
-
<% if link[:footer_links].present? %>
|
|
193
|
-
<hr class="gem-c-layout-super-navigation-header__navigation-second-footer-break govuk-section-break govuk-section-break--visible">
|
|
194
|
-
<ul class="gem-c-layout-super-navigation-header__navigation-second-footer-list">
|
|
195
|
-
<% link[:footer_links].each do | item | %>
|
|
196
|
-
<li class="gem-c-layout-super-navigation-header__navigation-second-footer-item">
|
|
105
|
+
<% end %>
|
|
106
|
+
|
|
107
|
+
<%= content_tag(:button, {
|
|
108
|
+
aria: {
|
|
109
|
+
controls: "super-navigation-menu-#{unique_id}",
|
|
110
|
+
expanded: false,
|
|
111
|
+
label: show_menu_text,
|
|
112
|
+
},
|
|
113
|
+
class: "gem-c-layout-super-navigation-header__navigation-top-toggle-button",
|
|
114
|
+
data: {
|
|
115
|
+
text_for_hide: hide_menu_text,
|
|
116
|
+
text_for_show: show_menu_text,
|
|
117
|
+
toggle_desktop_group: "top",
|
|
118
|
+
toggle_mobile_group: "top",
|
|
119
|
+
tracking_key: tracking_label,
|
|
120
|
+
ga4_event: {
|
|
121
|
+
event_name: "select_content",
|
|
122
|
+
type: "header menu bar",
|
|
123
|
+
text: link[:label],
|
|
124
|
+
index: 1,
|
|
125
|
+
index_total: 2,
|
|
126
|
+
section: link[:label]
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
hidden: true,
|
|
130
|
+
id: "super-navigation-menu-#{unique_id}-toggle",
|
|
131
|
+
type: "button",
|
|
132
|
+
}) do %>
|
|
133
|
+
<%= tag.span link[:label], class: "gem-c-layout-super-navigation-header__navigation-top-toggle-button-inner" %>
|
|
134
|
+
<% end %>
|
|
135
|
+
<%= tag.div class: "gem-c-layout-super-navigation-header__navigation-items" do %>
|
|
136
|
+
<div
|
|
137
|
+
id="super-navigation-menu-<%= unique_id %>" hidden
|
|
138
|
+
class="gem-c-layout-super-navigation-header__navigation-dropdown-menu"
|
|
139
|
+
>
|
|
140
|
+
<div class="gem-c-layout-super-navigation-header__width-container">
|
|
141
|
+
<div class="govuk-grid-row">
|
|
142
|
+
|
|
143
|
+
<% navigation_links_columns.each_with_index do | column, column_index | %>
|
|
144
|
+
<%
|
|
145
|
+
case column[:size]
|
|
146
|
+
when 2
|
|
147
|
+
width_class = "govuk-grid-column-two-thirds-from-desktop"
|
|
148
|
+
when 3
|
|
149
|
+
width_class = "govuk-grid-column-full-from-desktop"
|
|
150
|
+
else
|
|
151
|
+
width_class = "govuk-grid-column-one-third-from-desktop"
|
|
152
|
+
end
|
|
153
|
+
%>
|
|
154
|
+
|
|
155
|
+
<div class="<%= width_class %> gem-c-layout-super-navigation-header__column--<%= column[:label].downcase.sub(" ", "-") %>">
|
|
156
|
+
<h3 class="govuk-heading-m gem-c-layout-super-navigation-header__column-header">
|
|
157
|
+
<%= column[:label] %>
|
|
158
|
+
</h3>
|
|
159
|
+
<ul class="gem-c-layout-super-navigation-header__navigation-second-items gem-c-layout-super-navigation-header__navigation-second-items--<%= column[:label].downcase.sub(" ", "-") %>">
|
|
160
|
+
<% column[:menu_contents].each_with_index do | item, index | %>
|
|
161
|
+
<%
|
|
162
|
+
has_description = item[:description].present?
|
|
163
|
+
link_classes = %w[govuk-link gem-c-layout-super-navigation-header__navigation-second-item-link]
|
|
164
|
+
link_classes << "gem-c-layout-super-navigation-header__navigation-second-item-link--with-description" if has_description
|
|
165
|
+
tracking_label = column[:label].downcase.gsub(/\s+/, "")
|
|
166
|
+
%>
|
|
167
|
+
<li class="gem-c-layout-super-navigation-header__dropdown-list-item">
|
|
197
168
|
<%= link_to item[:label], item[:href], {
|
|
198
|
-
class:
|
|
199
|
-
"govuk-link",
|
|
200
|
-
"gem-c-layout-super-navigation-header__navigation-second-footer-link",
|
|
201
|
-
],
|
|
169
|
+
class: link_classes,
|
|
202
170
|
data: {
|
|
203
171
|
track_action: "#{tracking_label}Link",
|
|
204
172
|
track_category: "headerClicked",
|
|
205
173
|
track_label: item[:href],
|
|
206
174
|
track_dimension: item[:label],
|
|
207
175
|
track_dimension_index: "29",
|
|
176
|
+
ga4_link: {
|
|
177
|
+
"event_name": "navigation",
|
|
178
|
+
"type": "header menu bar",
|
|
179
|
+
"index": "1.#{column_index + 1}.#{index + 1}",
|
|
180
|
+
"index_total": navigation_links_length,
|
|
181
|
+
"section": column[:label],
|
|
182
|
+
}
|
|
208
183
|
}
|
|
209
184
|
} %>
|
|
185
|
+
<%= tag.p item[:description], class: "gem-c-layout-super-navigation-header__navigation-second-item-description" if has_description %>
|
|
210
186
|
</li>
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
<% end %>
|
|
187
|
+
<% end %>
|
|
188
|
+
</ul>
|
|
214
189
|
</div>
|
|
215
|
-
|
|
190
|
+
<% end %>
|
|
216
191
|
</div>
|
|
217
192
|
</div>
|
|
218
|
-
|
|
219
|
-
<% end %>
|
|
193
|
+
</div>
|
|
220
194
|
<% end %>
|
|
221
|
-
</ul>
|
|
222
195
|
|
|
223
196
|
<button
|
|
224
197
|
aria-controls="super-search-menu"
|
|
@@ -237,8 +210,8 @@
|
|
|
237
210
|
"event_name": "select_content",
|
|
238
211
|
"type": "header menu bar",
|
|
239
212
|
"text": "Search",
|
|
240
|
-
"index":
|
|
241
|
-
"index_total":
|
|
213
|
+
"index": 2,
|
|
214
|
+
"index_total": 2,
|
|
242
215
|
"section": "Search"
|
|
243
216
|
}.to_json %>"
|
|
244
217
|
>
|
|
@@ -265,7 +238,7 @@
|
|
|
265
238
|
</h3>
|
|
266
239
|
<div class="gem-c-layout-super-navigation-header__search-item">
|
|
267
240
|
<a class="gem-c-layout-super-navigation-header__search-item-link" href="/search">
|
|
268
|
-
<span class="
|
|
241
|
+
<span class="govuk-visually-hidden">
|
|
269
242
|
<%= search_text %>
|
|
270
243
|
</span>
|
|
271
244
|
<svg
|
|
@@ -328,7 +301,7 @@
|
|
|
328
301
|
<div class="govuk-grid-column-full">
|
|
329
302
|
<h3 class="govuk-heading-m"><%= popular_links_heading %></h3>
|
|
330
303
|
<ul class="govuk-list">
|
|
331
|
-
<% popular_links.
|
|
304
|
+
<% popular_links.each_with_index do | popular_link, index | %>
|
|
332
305
|
<li class="gem-c-layout-super-navigation-header__popular-item">
|
|
333
306
|
<%= link_to popular_link[:label], popular_link[:href], {
|
|
334
307
|
class: [
|
|
@@ -341,6 +314,13 @@
|
|
|
341
314
|
track_label: popular_link[:href],
|
|
342
315
|
track_dimension: popular_link[:label],
|
|
343
316
|
track_dimension_index: "29",
|
|
317
|
+
ga4_link: {
|
|
318
|
+
"event_name": "navigation",
|
|
319
|
+
"type": "header menu bar",
|
|
320
|
+
"index": "2.2.#{index + 1}",
|
|
321
|
+
"index_total": navigation_links_length,
|
|
322
|
+
"section": popular_links_heading,
|
|
323
|
+
}
|
|
344
324
|
}
|
|
345
325
|
} %>
|
|
346
326
|
</li>
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
<%
|
|
2
|
-
|
|
1
|
+
<%
|
|
2
|
+
related_nav_helper = GovukPublishingComponents::Presenters::RelatedNavigationHelper.new(local_assigns)
|
|
3
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
4
|
+
ga4_tracking ||= false
|
|
5
|
+
data = {}
|
|
6
|
+
data[:module] = "gem-track-click"
|
|
7
|
+
data[:module] << " ga4-link-tracker" if ga4_tracking
|
|
8
|
+
%>
|
|
3
9
|
|
|
4
10
|
<% if related_nav_helper.related_navigation? %>
|
|
5
11
|
<% random = SecureRandom.hex(4) %>
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
<%= tag.div(class: "gem-c-related-navigation", data: data) do %>
|
|
8
13
|
<% if local_assigns[:context] != :footer %>
|
|
9
14
|
<h2 id="related-nav-related_items-<%= random %>"
|
|
10
15
|
class="gem-c-related-navigation__main-heading"
|
|
@@ -33,7 +38,8 @@
|
|
|
33
38
|
section_title: section_title,
|
|
34
39
|
links: links,
|
|
35
40
|
section_index: section_index,
|
|
36
|
-
random: random
|
|
41
|
+
random: random,
|
|
42
|
+
ga4_tracking: ga4_tracking %>
|
|
37
43
|
<% end %>
|
|
38
|
-
|
|
44
|
+
<% end %>
|
|
39
45
|
<% end %>
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
</svg><%= sl_helper.email_signup_link_text %>
|
|
37
37
|
<% end %>
|
|
38
38
|
<%= link_to email_link_text, sl_helper.email_signup_link, {
|
|
39
|
-
class: "govuk-link
|
|
39
|
+
class: "govuk-link gem-c-subscription-links__item #{brand_helper.color_class} gem-c-subscription-links__item--link",
|
|
40
40
|
data: sl_helper.email_signup_link_data_attributes,
|
|
41
41
|
lang: email_signup_link_text_locale
|
|
42
42
|
} %>
|
|
@@ -17,6 +17,8 @@
|
|
|
17
17
|
hint_id = "hint-#{SecureRandom.hex(4)}"
|
|
18
18
|
has_error ||= error_message || error_items.any?
|
|
19
19
|
error_id = "error-#{SecureRandom.hex(4)}"
|
|
20
|
+
right_to_left ||= false
|
|
21
|
+
right_to_left_help = right_to_left_help.nil? ? right_to_left : right_to_left_help
|
|
20
22
|
|
|
21
23
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
22
24
|
|
|
@@ -39,13 +41,17 @@
|
|
|
39
41
|
|
|
40
42
|
<%= content_tag :div, class: form_group_css_classes do %>
|
|
41
43
|
<% if label %>
|
|
42
|
-
<%= render "govuk_publishing_components/components/label", {
|
|
44
|
+
<%= render "govuk_publishing_components/components/label", {
|
|
45
|
+
html_for: id,
|
|
46
|
+
right_to_left: right_to_left_help
|
|
47
|
+
}.merge(label.symbolize_keys) %>
|
|
43
48
|
<% end %>
|
|
44
49
|
|
|
45
50
|
<% if hint %>
|
|
46
51
|
<%= render "govuk_publishing_components/components/hint", {
|
|
47
52
|
id: hint_id,
|
|
48
|
-
text: hint
|
|
53
|
+
text: hint,
|
|
54
|
+
right_to_left: right_to_left_help
|
|
49
55
|
} %>
|
|
50
56
|
<% end %>
|
|
51
57
|
|
|
@@ -54,11 +60,13 @@
|
|
|
54
60
|
id: error_id,
|
|
55
61
|
text: error_message,
|
|
56
62
|
items: error_items,
|
|
63
|
+
right_to_left: right_to_left_help
|
|
57
64
|
} %>
|
|
58
65
|
<% end %>
|
|
59
66
|
|
|
60
67
|
<%= tag.textarea name: name,
|
|
61
68
|
class: css_classes,
|
|
69
|
+
dir: right_to_left ? "rtl" : nil,
|
|
62
70
|
id: id,
|
|
63
71
|
rows: rows,
|
|
64
72
|
maxlength: maxlength,
|
|
@@ -69,3 +69,46 @@ examples:
|
|
|
69
69
|
ordered_related_items:
|
|
70
70
|
- title: "Find an apprenticeship"
|
|
71
71
|
base_path: "/apply-apprenticeship"
|
|
72
|
+
with_ga4_tracking:
|
|
73
|
+
description: Adds Google Analytics 4 tracking to the Related Navigation component, if it is visible.
|
|
74
|
+
data:
|
|
75
|
+
ga4_tracking: true
|
|
76
|
+
content_item:
|
|
77
|
+
title: "A content item"
|
|
78
|
+
links:
|
|
79
|
+
topics:
|
|
80
|
+
- title: Apprenticeships, 14 to 19 education and training for work
|
|
81
|
+
base_path: /browse/education/find-course
|
|
82
|
+
document_type: topic
|
|
83
|
+
- title: Finding a job
|
|
84
|
+
base_path: /browse/working/finding-job
|
|
85
|
+
document_type: topic
|
|
86
|
+
- title: Apprenticeships
|
|
87
|
+
base_path: /topic/further-education-skills/apprenticeships
|
|
88
|
+
document_type: topic
|
|
89
|
+
topical_events:
|
|
90
|
+
- title: UK-China High-Level People to People Dialogue 2017
|
|
91
|
+
base_path: /government/topical-events/uk-china-high-level-people-to-people-dialogue-2017
|
|
92
|
+
document_type: topical_event
|
|
93
|
+
related:
|
|
94
|
+
- title: Pest Control
|
|
95
|
+
base_path: /pest-control
|
|
96
|
+
document_type: contact
|
|
97
|
+
related_statistical_data_sets:
|
|
98
|
+
- title: International road fuel prices
|
|
99
|
+
base_path: /government/statistical-data-sets/comparisons-of-industrial-and-domestic-energy-prices-monthly-figures
|
|
100
|
+
document_type: statistical_data_set
|
|
101
|
+
- title: Weekly road fuel prices
|
|
102
|
+
base_path: /government/statistical-data-sets/oil-and-petroleum-products-weekly-statistics
|
|
103
|
+
document_type: statistical_data_set
|
|
104
|
+
world_locations:
|
|
105
|
+
- title: South Sudan
|
|
106
|
+
base_path: /world/south-sudan/news
|
|
107
|
+
- title: USA
|
|
108
|
+
base_path: /world/usa/news
|
|
109
|
+
details:
|
|
110
|
+
external_related_links:
|
|
111
|
+
- url: "http://media.slc.co.uk/sfe/1718/ft/sfe_terms_and_conditions_guide_1718_d.pdf"
|
|
112
|
+
title: "Student loans: terms and conditions 2017 to 2018 (PDF, 136KB)"
|
|
113
|
+
- title: The Student Room repaying your student loan
|
|
114
|
+
url: https://www.thestudentroom.co.uk/content.php?r=5967-Repaying-your-student-loan
|