govuk_publishing_components 24.9.2 → 24.10.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/javascripts/govuk_publishing_components/analytics/pii.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +13 -248
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +1 -2
- data/app/assets/javascripts/govuk_publishing_components/components/cookie-banner.js +1 -0
- data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +12 -0
- data/app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js +18 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_accordion.scss +34 -34
- data/app/assets/stylesheets/govuk_publishing_components/components/_contextual-sidebar.scss +0 -37
- data/app/assets/stylesheets/govuk_publishing_components/components/_govspeak.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_metadata.scss +15 -18
- data/app/assets/stylesheets/govuk_publishing_components/components/_notice.scss +4 -2
- data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +4 -4
- data/app/assets/stylesheets/govuk_publishing_components/components/_step-by-step-nav.scss +20 -20
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_advisory.scss +27 -24
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_attachment.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_button.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_call-to-action.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_charts.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_contact.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_example.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_footnotes.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_form-download.scss +19 -16
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_fraction.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_highlight-answer.scss +30 -27
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_images.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_information-callout.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_legislative-list.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_place.scss +26 -21
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_stat-headline.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_steps.scss +19 -16
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_summary.scss +21 -18
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_tables.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_typography.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/govspeak/_warning-callout.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/helpers/_px-to-em.scss +2 -0
- data/app/views/govuk_publishing_components/components/_government_navigation.html.erb +7 -7
- data/app/views/govuk_publishing_components/components/_layout_header.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_metadata.html.erb +9 -8
- data/app/views/govuk_publishing_components/components/_notice.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/_radio.html.erb +6 -11
- data/app/views/govuk_publishing_components/components/_show_password.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/_step_by_step_nav.html.erb +4 -4
- 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/_success_alert.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb +9 -27
- data/app/views/govuk_publishing_components/components/docs/show_password.yml +10 -0
- data/app/views/govuk_publishing_components/components/docs/success_alert.yml +5 -0
- data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/metadata/_sentence.html.erb +2 -2
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +4 -3
- data/config/locales/cy.yml +0 -5
- data/config/locales/en.yml +12 -9
- data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +5 -0
- data/lib/govuk_publishing_components/presenters/contextual_navigation.rb +4 -0
- data/lib/govuk_publishing_components/presenters/related_navigation_helper.rb +0 -1
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +17 -3
- data/app/assets/javascripts/component_guide/visual-regression.js +0 -71
@@ -18,34 +18,35 @@
|
|
18
18
|
<%= content_tag :div, class: classes, data: { module: "gem-toggle" } do %>
|
19
19
|
<dl data-module="gem-track-click">
|
20
20
|
<% if from.any? %>
|
21
|
-
<dt class="gem-c-metadata__term"><%= t("
|
21
|
+
<dt class="gem-c-metadata__term"><%= t("components.metadata.from", default: "From") %>:</dt>
|
22
22
|
<dd class="gem-c-metadata__definition">
|
23
23
|
<%= render 'govuk_publishing_components/components/metadata/sentence', items: from, toggle_id: "from-#{SecureRandom.hex(4)}" %>
|
24
24
|
</dd>
|
25
25
|
<% end %>
|
26
26
|
<% if part_of.any? %>
|
27
|
-
<dt class="gem-c-metadata__term"><%= t("
|
27
|
+
<dt class="gem-c-metadata__term"><%= t("components.metadata.part_of", default: "Part of") %>:</dt>
|
28
28
|
<dd class="gem-c-metadata__definition">
|
29
29
|
<%= render 'govuk_publishing_components/components/metadata/sentence', items: part_of, toggle_id: "part-of-#{SecureRandom.hex(4)}" %>
|
30
30
|
</dd>
|
31
31
|
<% end %>
|
32
32
|
<% if local_assigns.include?(:history) %>
|
33
|
-
<dt class="gem-c-metadata__term"><%= t("
|
33
|
+
<dt class="gem-c-metadata__term"><%= t("components.metadata.history", default: "History") %>:</dt>
|
34
34
|
<dd class="gem-c-metadata__definition"><%= history %></dd>
|
35
35
|
<% end %>
|
36
36
|
<% if local_assigns.include?(:first_published) && first_published %>
|
37
|
-
<dt class="gem-c-metadata__term"><%= t("
|
37
|
+
<dt class="gem-c-metadata__term"><%= t("components.metadata.published", default: "Published") %></dt>
|
38
38
|
<dd class="gem-c-metadata__definition"><%= first_published %></dd>
|
39
39
|
<% end %>
|
40
40
|
<% if local_assigns.include?(:last_updated) && last_updated %>
|
41
|
-
<dt class="gem-c-metadata__term"><%= t("
|
41
|
+
<dt class="gem-c-metadata__term"><%= t("components.metadata.last_updated", default: "Last updated") %></dt>
|
42
42
|
<dd class="gem-c-metadata__definition">
|
43
|
-
<%= last_updated
|
44
|
-
|
43
|
+
<%= last_updated %>
|
44
|
+
<% if local_assigns.include?(:see_updates_link) %>
|
45
|
+
— <a href="#history" class="gem-c-metadata__definition-link"
|
45
46
|
data-track-category="content-history"
|
46
47
|
data-track-action="see-all-updates-link-clicked"
|
47
48
|
data-track-label="history">
|
48
|
-
<%= t("
|
49
|
+
<%= t("components.metadata.see_all_updates", default: "see all updates") %>
|
49
50
|
</a>
|
50
51
|
<% end %>
|
51
52
|
</dd>
|
@@ -10,7 +10,7 @@
|
|
10
10
|
|
11
11
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
12
12
|
|
13
|
-
css_classes = %w
|
13
|
+
css_classes = %w[gem-c-notice]
|
14
14
|
css_classes << (shared_helper.get_margin_bottom)
|
15
15
|
|
16
16
|
aria_attributes = aria_live ? {label: 'Notice', live: 'polite'} : {label: 'Notice'}
|
data/app/views/govuk_publishing_components/components/_previous_and_next_navigation.html.erb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
<nav
|
3
3
|
class="gem-c-pagination"
|
4
4
|
role="navigation"
|
5
|
-
aria-label="<%= t("
|
5
|
+
aria-label="<%= t("components.previous_and_next_navigation.pagination", default: "Pagination") %>"
|
6
6
|
>
|
7
7
|
<ul class="gem-c-pagination__list" data-module="gem-track-click">
|
8
8
|
<% if local_assigns.include?(:previous_page) %>
|
@@ -11,6 +11,9 @@
|
|
11
11
|
small ||= false
|
12
12
|
inline ||= false
|
13
13
|
is_page_heading ||= false
|
14
|
+
heading_level = is_page_heading ? 'h1' : shared_helper.get_heading_level
|
15
|
+
heading_classes = %w(govuk-fieldset__heading)
|
16
|
+
heading_classes << "gem-c-radio__heading-text" if heading_level == 'h1'
|
14
17
|
|
15
18
|
if ['s', 'm', 'l', 'xl'].include?(heading_size)
|
16
19
|
size = heading_size
|
@@ -46,20 +49,12 @@
|
|
46
49
|
%>
|
47
50
|
<%= tag.div id: id, class: form_group_css_classes do %>
|
48
51
|
<%= tag.fieldset class: "govuk-fieldset", "aria-describedby": aria do %>
|
49
|
-
|
50
52
|
<% if heading.present? %>
|
51
|
-
|
52
|
-
<%= tag.
|
53
|
-
|
54
|
-
<%= tag.h1 heading, class: "gem-c-radio__heading-text govuk-fieldset__heading" %>
|
55
|
-
<% end %>
|
56
|
-
<% else %>
|
57
|
-
<%= tag.legend class: legend_classes do %>
|
58
|
-
<%= content_tag(shared_helper.get_heading_level, heading, class: "govuk-fieldset__heading") %>
|
59
|
-
<% end %>
|
53
|
+
<%= tag.legend class: legend_classes do %>
|
54
|
+
<%= tag.span(heading_caption, class: "govuk-caption-#{size}") if heading_caption.present? %>
|
55
|
+
<%= content_tag(heading_level, heading, class: heading_classes) %>
|
60
56
|
<% end %>
|
61
57
|
<% end %>
|
62
|
-
|
63
58
|
<% if description.present? %>
|
64
59
|
<%= tag.div description, class: "govuk-body" %>
|
65
60
|
<% end %>
|
@@ -9,6 +9,7 @@
|
|
9
9
|
hint ||= nil
|
10
10
|
error_message ||= nil
|
11
11
|
error_items ||= nil
|
12
|
+
data ||= nil
|
12
13
|
|
13
14
|
if !label
|
14
15
|
raise ArgumentError, "This component requires a label"
|
@@ -37,6 +38,7 @@
|
|
37
38
|
error_items: error_items,
|
38
39
|
type: "password",
|
39
40
|
autocomplete: autocomplete,
|
41
|
+
data: data,
|
40
42
|
} %>
|
41
43
|
<% end %>
|
42
44
|
<% end %>
|
@@ -22,10 +22,10 @@
|
|
22
22
|
class="gem-c-step-nav js-hidden <% unless small %>gem-c-step-nav--large<% end %>"
|
23
23
|
<%= "data-remember" if remember_last_step %>
|
24
24
|
<%= "data-id=#{tracking_id}" if tracking_id %>
|
25
|
-
data-show-text="<%= t("
|
26
|
-
data-hide-text="<%= t("
|
27
|
-
data-show-all-text="<%= t("
|
28
|
-
data-hide-all-text="<%= t("
|
25
|
+
data-show-text="<%= t("components.step_by_step_nav.show", default: "show") %>"
|
26
|
+
data-hide-text="<%= t("components.step_by_step_nav.hide", default: "hide") %>"
|
27
|
+
data-show-all-text="<%= t("components.step_by_step_nav.show_all", default: "Show all steps") %>"
|
28
|
+
data-hide-all-text="<%= t("components.step_by_step_nav.hide_all", default: "Hide all steps") %>"
|
29
29
|
>
|
30
30
|
<ol class="gem-c-step-nav__steps">
|
31
31
|
<% steps.each_with_index do |step, step_index| %>
|
@@ -23,7 +23,7 @@
|
|
23
23
|
<% if sl_helper.component_data_is_valid? %>
|
24
24
|
<%= tag.section class: css_classes, data: data do %>
|
25
25
|
<% unless hide_heading %>
|
26
|
-
<h2 class="gem-c-subscription-links__hidden-header visuallyhidden"><%= t("
|
26
|
+
<h2 class="gem-c-subscription-links__hidden-header visuallyhidden"><%= t("components.subscription_links.subscriptions", default: "Subscriptions") %></h2>
|
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 %>"
|
@@ -13,7 +13,7 @@
|
|
13
13
|
module: "initial-focus",
|
14
14
|
} do %>
|
15
15
|
<div class="govuk-notification-banner__header">
|
16
|
-
<%= tag.h2 t("
|
16
|
+
<%= tag.h2 t("components.success_alert.success", default: "Success"), class: "govuk-notification-banner__title", id: title_id %>
|
17
17
|
</div>
|
18
18
|
<div class="govuk-notification-banner__content">
|
19
19
|
<% if description.present? %>
|
data/app/views/govuk_publishing_components/components/contextual_sidebar/_brexit_cta.html.erb
CHANGED
@@ -11,31 +11,13 @@
|
|
11
11
|
"track-dimension-index": "29",
|
12
12
|
} %>
|
13
13
|
|
14
|
-
<%=
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
<span class="gem-c-contextual-sidebar__take-action-traffic-lists-text">
|
24
|
-
<%= t("components.related_navigation.take_action_list.red") %>
|
25
|
-
</span>
|
26
|
-
</li>
|
27
|
-
<li>
|
28
|
-
<%= image_tag 'govuk_publishing_components/take-action-amber.svg', class: "gem-c-contextual-sidebar__take-action-traffic-lists-icon", alt: "" %>
|
29
|
-
<span class="gem-c-contextual-sidebar__take-action-traffic-lists-text">
|
30
|
-
<%= t("components.related_navigation.take_action_list.amber") %>
|
31
|
-
</span>
|
32
|
-
</li>
|
33
|
-
<li>
|
34
|
-
<%= image_tag 'govuk_publishing_components/take-action-green.svg', class: "gem-c-contextual-sidebar__take-action-traffic-lists-icon", alt: "" %>
|
35
|
-
<span class="gem-c-contextual-sidebar__take-action-traffic-lists-text">
|
36
|
-
<%= t("components.related_navigation.take_action_list.green") %>
|
37
|
-
</span>
|
38
|
-
</li>
|
39
|
-
</ul>
|
40
|
-
<p class="gem-c-contextual-sidebar__brexit-text"><%= link_text %></p>
|
14
|
+
<%= tag.div class: "gem-c-contextual-sidebar__brexit-cta" do %>
|
15
|
+
<%= tag.h2 t("components.related_navigation.transition.title"), class: "gem-c-contextual-sidebar__brexit-heading govuk-heading-s" %>
|
16
|
+
<%= tag.p class: "gem-c-contextual-sidebar__brexit-text govuk-body" do %>
|
17
|
+
<%= link_to link_text,
|
18
|
+
link_path,
|
19
|
+
class: "govuk-link",
|
20
|
+
data: data_attributes,
|
21
|
+
lang: shared_helper.t_locale("components.related_navigation.transition.title") %>
|
22
|
+
<% end %>
|
41
23
|
<% end %>
|
@@ -79,3 +79,13 @@ examples:
|
|
79
79
|
error_items:
|
80
80
|
- text: Look I keep telling you
|
81
81
|
- text: This isn't your password
|
82
|
+
with_data_attributes:
|
83
|
+
description: Data attributes can be passed to add to the input element. If the data attribute starts with `data-button-` this attribute will be applied to the show/hide button, instead of the input. Note that if JS is disabled, all attributes are added to the input.
|
84
|
+
data:
|
85
|
+
label:
|
86
|
+
text: Your password
|
87
|
+
data:
|
88
|
+
example_1: value
|
89
|
+
example_2: thing
|
90
|
+
button_example_1: wotsit
|
91
|
+
button_example_2: doodad
|
@@ -24,6 +24,11 @@ examples:
|
|
24
24
|
data:
|
25
25
|
message: Message to alert the user to a successful action goes here
|
26
26
|
title_id: my-custom-success-id
|
27
|
+
with_styled_link:
|
28
|
+
description: If you need to include a link in your success alert, you need to specify the `govuk-link` and `govuk-notification-banner__link` classes on that link element. This is in line with Design System guidance that the colour of the link in success notification banners can look jarring if any links are a different colour to the principal colour used by the success banner.
|
29
|
+
data:
|
30
|
+
message: Message to alert the user to a successful action goes here
|
31
|
+
description: <p class="govuk-body">A further description with <a href="/a-cool-page" class="govuk-link govuk-notification-banner__link">a link</a></p>
|
27
32
|
long_example:
|
28
33
|
data:
|
29
34
|
message: |
|
@@ -28,7 +28,7 @@
|
|
28
28
|
</div>
|
29
29
|
<div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-questions--something-is-wrong js-prompt-questions">
|
30
30
|
<button class="govuk-button gem-c-feedback__prompt-link js-toggle-form js-something-is-wrong" data-track-category="Onsite Feedback" data-track-action="GOV-UK Open Form" aria-controls="something-is-wrong" aria-expanded="false">
|
31
|
-
<%= t("components.feedback.something_wrong", default: "
|
31
|
+
<%= t("components.feedback.something_wrong", default: "Report a problem with this page") %>
|
32
32
|
</button>
|
33
33
|
</div>
|
34
34
|
</div>
|
data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb
CHANGED
@@ -7,7 +7,7 @@
|
|
7
7
|
class="govuk-header__menu-button govuk-js-header-toggle gem-c-header__menu-button"
|
8
8
|
type="button"
|
9
9
|
>
|
10
|
-
|
10
|
+
<%= t("components.layout_header.menu") %>
|
11
11
|
</button>
|
12
12
|
<%= tag.nav class: "gem-c-header__nav", aria: { label: navigation_aria_label } do %>
|
13
13
|
<ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end">
|
@@ -13,8 +13,8 @@
|
|
13
13
|
class="gem-c-metadata__definition-link"
|
14
14
|
data-controls="toggle-<%= toggle_id %>"
|
15
15
|
data-expanded="false"
|
16
|
-
data-toggled-text="<%= t("
|
17
|
-
<%= t("
|
16
|
+
data-toggled-text="<%= t("components.metadata.toggle_less", default: "Show fewer") %>">
|
17
|
+
<%= t("components.metadata.toggle_more", number: remaining.length, default: "+ #{remaining.length} more") %>
|
18
18
|
</a>
|
19
19
|
</div>
|
20
20
|
<span id="toggle-<%= toggle_id %>" class="gem-c-metadata__toggle-items js-hidden"><%= remaining.to_sentence.html_safe %></span>
|
@@ -23,10 +23,11 @@
|
|
23
23
|
|
24
24
|
<% links.each.with_index(1) do |link, index| %>
|
25
25
|
<%
|
26
|
+
link_class = "govuk-link #{related_nav_helper.section_css_class("govuk-link gem-c-related-navigation__section-link", section_title, link: link, link_is_inline: (index >= section_link_limit))}"
|
26
27
|
link_element = link_to(
|
27
28
|
link[:text],
|
28
29
|
link[:path],
|
29
|
-
class:
|
30
|
+
class: link_class,
|
30
31
|
rel: link[:rel],
|
31
32
|
lang: shared_helper.t_locale_check(link[:locale]),
|
32
33
|
data: {
|
@@ -53,8 +54,8 @@
|
|
53
54
|
class="gem-c-related-navigation__toggle"
|
54
55
|
data-controls="toggle_<%= section_title %>"
|
55
56
|
data-expanded="false"
|
56
|
-
data-toggled-text="<%= t("
|
57
|
-
<%= t("
|
57
|
+
data-toggled-text="<%= t("components.metadata.toggle_less", default: "Show fewer") %>">
|
58
|
+
<%= t("components.metadata.toggle_more",
|
58
59
|
number: related_nav_helper.remaining_link_count(links),
|
59
60
|
default: "+ #{related_nav_helper.remaining_link_count(links)} more") %>
|
60
61
|
</a>
|
data/config/locales/cy.yml
CHANGED
data/config/locales/en.yml
CHANGED
@@ -44,13 +44,13 @@ en:
|
|
44
44
|
contents: "Contents"
|
45
45
|
feedback:
|
46
46
|
is_this_page_useful: "Is this page useful?"
|
47
|
-
yes: "Yes"
|
48
|
-
no: "No"
|
47
|
+
"yes": "Yes"
|
48
|
+
"no": "No"
|
49
49
|
maybe: "Maybe"
|
50
50
|
is_useful: "this page is useful"
|
51
51
|
is_not_useful: "this page is not useful"
|
52
52
|
thank_you_for_feedback: "Thank you for your feedback"
|
53
|
-
something_wrong: "
|
53
|
+
something_wrong: "Report a problem with this page"
|
54
54
|
close: "Close"
|
55
55
|
help_us_improve_govuk: "Help us improve GOV.UK"
|
56
56
|
more_about_visit: "To help us improve GOV.UK, we’d like to know more about your visit today. We’ll send you a link to a feedback form. It will take only 2 minutes to fill in. Don’t worry we won’t send you spam or share your email address with anyone."
|
@@ -65,8 +65,16 @@ en:
|
|
65
65
|
show_button: "Show search"
|
66
66
|
hide_button: "Hide search"
|
67
67
|
top_level: "Top level"
|
68
|
-
nav_items_aria_label: "Show or hide Top Level Navigation"
|
69
68
|
menu: "Menu"
|
69
|
+
metadata:
|
70
|
+
from: "From"
|
71
|
+
part_of: "Part of"
|
72
|
+
history: "History"
|
73
|
+
published: "Published"
|
74
|
+
last_updated: "Last updated"
|
75
|
+
see_all_updates: "See all updates"
|
76
|
+
toggle_less: "Show fewer"
|
77
|
+
toggle_more: "+ %{number} more"
|
70
78
|
organisation_schema:
|
71
79
|
all_content_search_description: "Find all content from %{organisation}"
|
72
80
|
radio:
|
@@ -88,11 +96,6 @@ en:
|
|
88
96
|
title: "Brexit"
|
89
97
|
link_path: "/transition"
|
90
98
|
link_text: "Check what you need to do"
|
91
|
-
take_action_list:
|
92
|
-
red: "Check"
|
93
|
-
amber: "Change"
|
94
|
-
green: "Go"
|
95
|
-
aria_label: "Brexit campaign slogan, Check, Change, Go."
|
96
99
|
related_footer_navigation:
|
97
100
|
collections: "Collections"
|
98
101
|
policies: "Policies"
|
@@ -60,6 +60,11 @@ module GovukPublishingComponents
|
|
60
60
|
step_by_step: false,
|
61
61
|
breadcrumbs: navigation.breadcrumbs,
|
62
62
|
}
|
63
|
+
elsif navigation.content_is_travel_advice?
|
64
|
+
{
|
65
|
+
step_by_step: false,
|
66
|
+
breadcrumbs: navigation.breadcrumbs,
|
67
|
+
}
|
63
68
|
elsif navigation.content_has_a_topic?
|
64
69
|
{
|
65
70
|
step_by_step: false,
|
@@ -16,6 +16,10 @@ module GovukPublishingComponents
|
|
16
16
|
content_item["document_type"] == "simple_smart_answer"
|
17
17
|
end
|
18
18
|
|
19
|
+
def content_is_travel_advice?
|
20
|
+
content_item["document_type"] == "travel_advice"
|
21
|
+
end
|
22
|
+
|
19
23
|
def html_publication_with_parent?
|
20
24
|
(content_item["document_type"] == "html_publication") && parent_api_path
|
21
25
|
end
|
@@ -67,7 +67,6 @@ module GovukPublishingComponents
|
|
67
67
|
|
68
68
|
def section_css_class(css_class, section_title, link: {}, link_is_inline: false)
|
69
69
|
css_classes = [css_class]
|
70
|
-
css_classes << "govuk-link"
|
71
70
|
css_classes << "#{css_class}--#{@context}" unless @context.nil?
|
72
71
|
css_classes << "#{css_class}--inline" if link_is_inline
|
73
72
|
|
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.
|
4
|
+
version: 24.10.2
|
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-
|
11
|
+
date: 2021-05-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: govuk_app_config
|
@@ -164,6 +164,20 @@ dependencies:
|
|
164
164
|
- - "~>"
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '2'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: i18n-coverage
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - ">="
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - ">="
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '0'
|
167
181
|
- !ruby/object:Gem::Dependency
|
168
182
|
name: jasmine
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
@@ -416,7 +430,6 @@ files:
|
|
416
430
|
- app/assets/javascripts/component_guide/filter-components.js
|
417
431
|
- app/assets/javascripts/component_guide/vendor/bind-polyfill.js
|
418
432
|
- app/assets/javascripts/component_guide/vendor/matches-polyfill.min.js
|
419
|
-
- app/assets/javascripts/component_guide/visual-regression.js
|
420
433
|
- app/assets/javascripts/govuk_publishing_components/all_components.js
|
421
434
|
- app/assets/javascripts/govuk_publishing_components/analytics.js
|
422
435
|
- app/assets/javascripts/govuk_publishing_components/analytics/analytics.js
|
@@ -469,6 +482,7 @@ files:
|
|
469
482
|
- app/assets/javascripts/govuk_publishing_components/lib/toggle-input-class-on-focus.js
|
470
483
|
- app/assets/javascripts/govuk_publishing_components/lib/toggle.js
|
471
484
|
- app/assets/javascripts/govuk_publishing_components/lib/track-click.js
|
485
|
+
- app/assets/javascripts/govuk_publishing_components/lib/trigger-event.js
|
472
486
|
- app/assets/javascripts/govuk_publishing_components/modules.js
|
473
487
|
- app/assets/javascripts/govuk_publishing_components/vendor/html5shiv-printshiv.js
|
474
488
|
- app/assets/javascripts/govuk_publishing_components/vendor/json2.js
|