govuk_publishing_components 24.2.0 → 24.5.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/javascripts/govuk_publishing_components/analytics/scroll-tracker.js +28 -0
- data/app/assets/javascripts/govuk_publishing_components/components/accordion.js +52 -8
- data/app/assets/javascripts/govuk_publishing_components/components/details.js +1 -1
- data/app/assets/javascripts/govuk_publishing_components/components/reorderable-list.js +108 -0
- data/app/assets/javascripts/govuk_publishing_components/components/show-password.js +7 -2
- data/app/assets/javascripts/govuk_publishing_components/lib/header-navigation.js +6 -2
- data/app/assets/stylesheets/component_guide/application.scss +0 -8
- data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
- data/app/assets/stylesheets/govuk_publishing_components/_all_components_print.scss +1 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +11 -0
- data/app/assets/stylesheets/govuk_publishing_components/components/_cookie-banner.scss +8 -1
- data/app/assets/stylesheets/govuk_publishing_components/components/_reorderable-list.scss +117 -0
- 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/audit/show.html.erb +211 -199
- data/app/views/govuk_publishing_components/components/_accordion.html.erb +3 -3
- data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +8 -5
- 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/_list.html.erb +5 -5
- 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/_radio.html.erb +2 -1
- data/app/views/govuk_publishing_components/components/_reorderable_list.html.erb +45 -0
- data/app/views/govuk_publishing_components/components/_search.html.erb +27 -16
- data/app/views/govuk_publishing_components/components/_share_links.html.erb +1 -1
- data/app/views/govuk_publishing_components/components/_show_password.html.erb +6 -4
- 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/_summary_list.html.erb +67 -30
- 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/accordion.yml +29 -0
- data/app/views/govuk_publishing_components/components/docs/breadcrumbs.yml +22 -0
- data/app/views/govuk_publishing_components/components/docs/inverse_header.yml +1 -1
- data/app/views/govuk_publishing_components/components/docs/radio.yml +14 -1
- data/app/views/govuk_publishing_components/components/docs/reorderable_list.yml +85 -0
- data/app/views/govuk_publishing_components/components/docs/search.yml +10 -0
- data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +2 -0
- data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +17 -3
- data/app/views/govuk_publishing_components/components/related_navigation/_section.html.erb +2 -2
- data/config/locales/en.yml +25 -15
- 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
- data/node_modules/sortablejs/LICENSE +21 -0
- data/node_modules/sortablejs/README.md +815 -0
- data/node_modules/sortablejs/Sortable.js +3721 -0
- data/node_modules/sortablejs/Sortable.min.js +2 -0
- data/node_modules/sortablejs/modular/sortable.complete.esm.js +3713 -0
- data/node_modules/sortablejs/modular/sortable.core.esm.js +3710 -0
- data/node_modules/sortablejs/modular/sortable.esm.js +3711 -0
- data/node_modules/sortablejs/package.json +56 -0
- metadata +19 -7
@@ -5,6 +5,7 @@
|
|
5
5
|
id ||= "default-id-#{SecureRandom.hex(4)}"
|
6
6
|
items ||= []
|
7
7
|
condensed ||= false
|
8
|
+
anchor_navigation ||= false
|
8
9
|
|
9
10
|
accordion_classes = %w(gem-c-accordion)
|
10
11
|
accordion_classes << 'gem-c-accordion--condensed' if condensed
|
@@ -12,6 +13,7 @@
|
|
12
13
|
|
13
14
|
data_attributes ||= {}
|
14
15
|
data_attributes[:module] = 'gem-accordion'
|
16
|
+
data_attributes[:anchor_navigation] = anchor_navigation
|
15
17
|
%>
|
16
18
|
<% if items.any? %>
|
17
19
|
<%= tag.div(class: accordion_classes, id: id, data: data_attributes) do %>
|
@@ -19,8 +21,6 @@
|
|
19
21
|
<%
|
20
22
|
index = i + 1
|
21
23
|
|
22
|
-
item[:data_attributes] ||= nil
|
23
|
-
|
24
24
|
section_classes = %w(gem-c-accordion__section)
|
25
25
|
section_classes << 'gem-c-accordion__section--expanded' if item[:expanded]
|
26
26
|
|
@@ -29,7 +29,7 @@
|
|
29
29
|
|
30
30
|
<%= tag.section(class: section_classes) do %>
|
31
31
|
<div class="gem-c-accordion__section-header">
|
32
|
-
<%= content_tag(shared_helper.get_heading_level, class: 'gem-c-accordion__section-heading') do %>
|
32
|
+
<%= content_tag(shared_helper.get_heading_level, class: 'gem-c-accordion__section-heading', id: item[:heading][:id]) do %>
|
33
33
|
<%= tag.span(item[:heading][:text], id: "#{id}-heading-#{index}", data: item[:data_attributes], class: 'gem-c-accordion__section-button') %>
|
34
34
|
<% end %>
|
35
35
|
<%= tag.div(item[:summary][:text], id: "#{id}-summary-#{index}", class: summary_classes) if item[:summary].present? %>
|
@@ -1,19 +1,22 @@
|
|
1
1
|
<%
|
2
|
+
border ||= false
|
2
3
|
breadcrumbs ||= []
|
3
|
-
inverse ||= false
|
4
4
|
collapse_on_mobile ||= false
|
5
|
+
inverse ||= false
|
6
|
+
|
5
7
|
breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)
|
6
8
|
|
7
|
-
classes =
|
8
|
-
classes << "
|
9
|
-
classes << "
|
9
|
+
classes = %w[gem-c-breadcrumbs govuk-breadcrumbs]
|
10
|
+
classes << "govuk-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
|
11
|
+
classes << "gem-c-breadcrumbs--inverse" if inverse
|
12
|
+
classes << "gem-c-breadcrumbs--border-bottom" if border == "bottom"
|
10
13
|
%>
|
11
14
|
|
12
15
|
<script type="application/ld+json">
|
13
16
|
<%= raw JSON.pretty_generate(breadcrumb_presenter.structured_data) %>
|
14
17
|
</script>
|
15
18
|
|
16
|
-
<div class="<%= classes %>" data-module="track-click">
|
19
|
+
<div class="<%= classes.join(" ") %>" data-module="gem-track-click">
|
17
20
|
<ol class="govuk-breadcrumbs__list">
|
18
21
|
<% breadcrumbs.each_with_index do |crumb, index| %>
|
19
22
|
<% 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">
|
@@ -1,12 +1,12 @@
|
|
1
1
|
<%
|
2
|
-
|
2
|
+
aria_label ||= nil
|
3
3
|
extra_spacing ||= nil
|
4
|
+
id ||= nil
|
5
|
+
items ||= []
|
4
6
|
list_type ||= "unordered"
|
5
7
|
visible_counters ||= nil
|
6
|
-
items ||= []
|
7
|
-
aria_label ||= nil
|
8
8
|
|
9
|
-
classes = %w
|
9
|
+
classes = %w[gem-c-list govuk-list]
|
10
10
|
classes << "govuk-list--bullet" if visible_counters && list_type === "unordered"
|
11
11
|
classes << "govuk-list--number" if visible_counters && list_type === "number"
|
12
12
|
classes << "govuk-list--spaced" if extra_spacing
|
@@ -20,7 +20,7 @@
|
|
20
20
|
<% if items.any? %>
|
21
21
|
<%= content_tag list_tag, class: classes, id: id, "aria-label": aria_label do %>
|
22
22
|
<% items.each do |item| %>
|
23
|
-
<li><%=
|
23
|
+
<li><%= raw(item) %></li>
|
24
24
|
<% end %>
|
25
25
|
<% end %>
|
26
26
|
<% end %>
|
@@ -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] %>"
|
@@ -1,4 +1,5 @@
|
|
1
1
|
<%
|
2
|
+
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
2
3
|
id ||= nil
|
3
4
|
id_prefix ||= "radio-#{SecureRandom.hex(4)}"
|
4
5
|
items ||= []
|
@@ -54,7 +55,7 @@
|
|
54
55
|
<% end %>
|
55
56
|
<% else %>
|
56
57
|
<%= tag.legend class: legend_classes do %>
|
57
|
-
<%=
|
58
|
+
<%= content_tag(shared_helper.get_heading_level, heading, class: "govuk-fieldset__heading") %>
|
58
59
|
<% end %>
|
59
60
|
<% end %>
|
60
61
|
<% end %>
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<%
|
2
|
+
items ||= []
|
3
|
+
input_name ||= "ordering"
|
4
|
+
data_attributes ||= {}
|
5
|
+
data_attributes[:module] = "reorderable-list"
|
6
|
+
%>
|
7
|
+
|
8
|
+
<%= tag.ol class: "gem-c-reorderable-list", data: data_attributes do %>
|
9
|
+
<% items.each_with_index do |item, index| %>
|
10
|
+
<%= tag.li class: "gem-c-reorderable-list__item" do %>
|
11
|
+
<%= tag.div class: "gem-c-reorderable-list__wrapper" do %>
|
12
|
+
<%= tag.div class: "gem-c-reorderable-list__content" do %>
|
13
|
+
<%= tag.p item[:title], class: "gem-c-reorderable-list__title" %>
|
14
|
+
<%= tag.p(item[:description], class: "gem-c-reorderable-list__description") if item[:description].present? %>
|
15
|
+
<% end %>
|
16
|
+
<%= tag.div class: "gem-c-reorderable-list__actions" do %>
|
17
|
+
<% label_text = capture do %>
|
18
|
+
Position<span class='govuk-visually-hidden'> for <%= item[:title] %></span>
|
19
|
+
<% end %>
|
20
|
+
<%= render "govuk_publishing_components/components/input", {
|
21
|
+
label: { text: label_text },
|
22
|
+
name: "#{input_name}[#{item[:id]}]",
|
23
|
+
type: "number",
|
24
|
+
value: index + 1,
|
25
|
+
width: 2
|
26
|
+
} %>
|
27
|
+
<%= render "govuk_publishing_components/components/button", {
|
28
|
+
text: "Up",
|
29
|
+
type: "button",
|
30
|
+
aria_label: "Move \"#{item[:title]}\" up",
|
31
|
+
classes: "js-reorderable-list-up",
|
32
|
+
secondary_solid: true
|
33
|
+
} %>
|
34
|
+
<%= render "govuk_publishing_components/components/button", {
|
35
|
+
text: "Down",
|
36
|
+
type: "button",
|
37
|
+
aria_label: "Move \"#{item[:title]}\" down",
|
38
|
+
classes: "js-reorderable-list-down",
|
39
|
+
secondary_solid: true
|
40
|
+
} %>
|
41
|
+
<% end %>
|
42
|
+
<% end %>
|
43
|
+
<% end %>
|
44
|
+
<% end %>
|
45
|
+
<% end %>
|
@@ -1,11 +1,19 @@
|
|
1
1
|
<%
|
2
|
-
size ||= ""
|
3
|
-
no_border ||= false
|
4
2
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
5
|
-
|
3
|
+
|
4
|
+
aria_controls ||= nil
|
5
|
+
button_text ||= t("components.search_box.search_button")
|
6
|
+
id ||= "search-main-" + SecureRandom.hex(4)
|
7
|
+
label_text ||= t("components.search_box.label")
|
8
|
+
name ||= "q"
|
9
|
+
no_border ||= false
|
10
|
+
size ||= ""
|
11
|
+
value ||= ""
|
12
|
+
|
13
|
+
classes = %w[gem-c-search]
|
6
14
|
classes << (shared_helper.get_margin_top)
|
7
15
|
classes << (shared_helper.get_margin_bottom) if local_assigns[:margin_bottom]
|
8
|
-
classes << "gem-c-search--large" if size ==
|
16
|
+
classes << "gem-c-search--large" if size == "large"
|
9
17
|
classes << "gem-c-search--no-border" if no_border
|
10
18
|
if local_assigns[:on_govuk_blue].eql?(true)
|
11
19
|
classes << "gem-c-search--on-govuk-blue"
|
@@ -13,25 +21,28 @@
|
|
13
21
|
classes << "gem-c-search--on-white"
|
14
22
|
end
|
15
23
|
classes << "gem-c-search--separate-label" if local_assigns.include?(:inline_label)
|
16
|
-
|
17
|
-
value ||= ""
|
18
|
-
id ||= "search-main-" + SecureRandom.hex(4)
|
19
|
-
label_text ||= "Search on GOV.UK"
|
20
|
-
name ||= 'q'
|
21
|
-
aria_controls ||= nil
|
22
24
|
%>
|
23
25
|
|
24
|
-
<div class="<%= classes.join(
|
26
|
+
<div class="<%= classes.join(" ") %>" data-module="gem-toggle-input-class-on-focus">
|
25
27
|
<label for="<%= id %>" class="gem-c-search__label">
|
26
28
|
<%= label_text %>
|
27
29
|
</label>
|
28
30
|
<div class="gem-c-search__item-wrapper">
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
31
|
+
<%= tag.input(
|
32
|
+
aria: {
|
33
|
+
controls: aria_controls,
|
34
|
+
},
|
35
|
+
class: "gem-c-search__item gem-c-search__input js-class-toggle",
|
36
|
+
id: id,
|
37
|
+
name: name,
|
38
|
+
title: t("components.search_box.input_title"),
|
39
|
+
type: "search",
|
40
|
+
value: value,
|
41
|
+
) %>
|
33
42
|
<div class="gem-c-search__item gem-c-search__submit-wrapper">
|
34
|
-
<button
|
43
|
+
<button class="gem-c-search__submit" type="submit">
|
44
|
+
<%= button_text %>
|
45
|
+
</button>
|
35
46
|
</div>
|
36
47
|
</div>
|
37
48
|
</div>
|
@@ -19,10 +19,12 @@
|
|
19
19
|
data: {
|
20
20
|
module: "show-password",
|
21
21
|
disable_form_submit_check: disable_form_submit_check,
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
22
|
+
show_text: t('components.show_password.show'),
|
23
|
+
hide_text: t('components.show_password.hide'),
|
24
|
+
show_full_text: t('components.show_password.show_password'),
|
25
|
+
hide_full_text: t('components.show_password.hide_password'),
|
26
|
+
announce_show: t('components.show_password.announce_show'),
|
27
|
+
announce_hide: t('components.show_password.announce_hide')
|
26
28
|
} do %>
|
27
29
|
<%= render "govuk_publishing_components/components/input", {
|
28
30
|
label: label,
|
@@ -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 %>" >
|
@@ -15,32 +15,51 @@
|
|
15
15
|
<%= tag.div class: "gem-c-summary-list #{"govuk-summary-list--no-border" if borderless}", id: id do %>
|
16
16
|
<% if title %>
|
17
17
|
<%= content_tag(shared_helper.get_heading_level, title, class: "govuk-heading-#{heading_size} gem-c-summary-list__group-title") %>
|
18
|
-
|
18
|
+
|
19
|
+
<% if edit.any? %>
|
20
|
+
<% edit_main_link = capture do %>
|
21
|
+
<% edit_section_link_text = edit[:link_text] || t("components.summary_list.edit") %>
|
22
|
+
<%= link_to edit.fetch(:href),
|
23
|
+
class: "govuk-link",
|
24
|
+
title: "#{edit_section_link_text} #{title}",
|
25
|
+
data: edit.fetch(:data_attributes, {}) do %>
|
26
|
+
<%= edit_section_link_text %><%= tag.span " #{title}", class: "govuk-visually-hidden" -%>
|
27
|
+
<% end %>
|
28
|
+
<% end %>
|
29
|
+
<% end %>
|
30
|
+
|
31
|
+
<% if delete.any? %>
|
32
|
+
<% delete_main_link = capture do %>
|
33
|
+
<% delete_section_link_text = delete[:link_text] || t("components.summary_list.delete") %>
|
34
|
+
<%= link_to delete.fetch(:href),
|
35
|
+
class: "govuk-link gem-link--destructive",
|
36
|
+
title: "#{delete_section_link_text} #{title}",
|
37
|
+
data: delete.fetch(:data_attributes, {}) do %>
|
38
|
+
<%= delete_section_link_text %><%= tag.span " #{title}", class: "govuk-visually-hidden" -%>
|
39
|
+
<% end %>
|
40
|
+
<% end %>
|
41
|
+
<% end %>
|
42
|
+
|
43
|
+
<% if edit_main_link && delete_main_link %>
|
19
44
|
<%= tag.ul class: "govuk-summary-list__actions-list gem-c-summary-list__group-actions-list" do %>
|
20
45
|
<%- if edit.any? %>
|
21
|
-
<% edit_section_link_text = edit[:link_text] || t("components.summary_list.edit") %>
|
22
46
|
<%= tag.li class: "govuk-summary-list__actions-list-item" do -%>
|
23
|
-
<%=
|
24
|
-
class: "govuk-link",
|
25
|
-
title: "#{edit_section_link_text} #{title}",
|
26
|
-
data: edit.fetch(:data_attributes, {}) do %>
|
27
|
-
<%= edit_section_link_text %><%= tag.span " #{title}", class: "govuk-visually-hidden" -%>
|
28
|
-
<% end %>
|
47
|
+
<%= edit_main_link %>
|
29
48
|
<% end %>
|
30
49
|
<% end %>
|
31
50
|
<% if delete.any? %>
|
32
|
-
<% delete_section_link_text = delete[:link_text] || t("components.summary_list.delete") %>
|
33
51
|
<%= tag.li class: "govuk-summary-list__actions-list-item" do -%>
|
34
|
-
<%=
|
35
|
-
class: "govuk-link gem-link--destructive",
|
36
|
-
title: "#{delete_section_link_text} #{title}",
|
37
|
-
data: delete.fetch(:data_attributes, {}) do %>
|
38
|
-
<%= delete_section_link_text %><%= tag.span " #{title}", class: "govuk-visually-hidden" -%>
|
39
|
-
<% end %>
|
52
|
+
<%= delete_main_link %>
|
40
53
|
<% end %>
|
41
54
|
<% end %>
|
42
55
|
<% end %>
|
56
|
+
<% else %>
|
57
|
+
<%= tag.div class: "govuk-summary-list__actions-list gem-c-summary-list__group-actions-list" do %>
|
58
|
+
<%= edit_main_link %>
|
59
|
+
<%= delete_main_link %>
|
60
|
+
<% end %>
|
43
61
|
<% end %>
|
62
|
+
|
44
63
|
<% end %>
|
45
64
|
|
46
65
|
<% if items.any? %>
|
@@ -51,34 +70,52 @@
|
|
51
70
|
<%= tag.dt item[:field], class: "govuk-summary-list__key" %>
|
52
71
|
<%= tag.dd item[:value], class: "govuk-summary-list__value" %>
|
53
72
|
|
54
|
-
<% if item.fetch(:edit, {}).any?
|
73
|
+
<% if item.fetch(:edit, {}).any? %>
|
74
|
+
<% edit_link = capture do %>
|
75
|
+
<% edit_link_text = item[:edit][:link_text] || t("components.summary_list.edit") %>
|
76
|
+
<%= link_to item[:edit].fetch(:href),
|
77
|
+
class: "govuk-link",
|
78
|
+
title: "#{edit_link_text} #{item[:field]}",
|
79
|
+
data: item[:edit].fetch(:data_attributes, {}) do %>
|
80
|
+
<%= edit_link_text %><%= tag.span " #{item[:field]}", class: "govuk-visually-hidden" -%>
|
81
|
+
<% end %>
|
82
|
+
<% end %>
|
83
|
+
<% end %>
|
84
|
+
|
85
|
+
<% if item.fetch(:delete, {}).any? %>
|
86
|
+
<% delete_link = capture do %>
|
87
|
+
<% delete_link_text = item[:delete][:link_text] || t("components.summary_list.delete") %>
|
88
|
+
<%= link_to item[:delete].fetch(:href),
|
89
|
+
class: "govuk-link gem-link--destructive",
|
90
|
+
title: "#{delete_link_text} #{item[:field]}",
|
91
|
+
data: item[:delete].fetch(:data_attributes, {}) do %>
|
92
|
+
<%= delete_link_text %><%= tag.span " #{item[:field]}", class: "govuk-visually-hidden" -%>
|
93
|
+
<% end %>
|
94
|
+
<% end %>
|
95
|
+
<% end %>
|
96
|
+
|
97
|
+
<% if edit_link && delete_link %>
|
55
98
|
<%= tag.dd class: "govuk-summary-list__actions" do %>
|
56
99
|
<%= tag.ul class: "govuk-summary-list__actions-list" do %>
|
57
100
|
<% if item.fetch(:edit, {}).any? %>
|
58
101
|
<%= tag.li class: "govuk-summary-list__actions-list-item" do %>
|
59
|
-
|
60
|
-
<%= link_to item[:edit].fetch(:href),
|
61
|
-
class: "govuk-link",
|
62
|
-
title: "#{edit_link_text} #{item[:field]}",
|
63
|
-
data: item[:edit].fetch(:data_attributes, {}) do %>
|
64
|
-
<%= edit_link_text %><%= tag.span " #{item[:field]}", class: "govuk-visually-hidden" -%>
|
65
|
-
<% end %>
|
102
|
+
<%= edit_link %>
|
66
103
|
<% end %>
|
67
104
|
<% end %>
|
68
105
|
<% if item.fetch(:delete, {}).any? %>
|
69
106
|
<%= tag.li class: "govuk-summary-list__actions-list-item" do %>
|
70
|
-
|
71
|
-
<%= link_to item[:delete].fetch(:href),
|
72
|
-
class: "govuk-link gem-link--destructive",
|
73
|
-
title: "#{delete_link_text} #{item[:field]}",
|
74
|
-
data: item[:delete].fetch(:data_attributes, {}) do %>
|
75
|
-
<%= delete_link_text %><%= tag.span " #{item[:field]}", class: "govuk-visually-hidden" -%>
|
76
|
-
<% end %>
|
107
|
+
<%= delete_link %>
|
77
108
|
<% end %>
|
78
109
|
<% end %>
|
79
110
|
<% end %>
|
80
111
|
<% end %>
|
112
|
+
<% else %>
|
113
|
+
<%= tag.dd class: "govuk-summary-list__actions" do %>
|
114
|
+
<%= edit_link %>
|
115
|
+
<%= delete_link %>
|
116
|
+
<% end %>
|
81
117
|
<% end %>
|
118
|
+
|
82
119
|
<% end %>
|
83
120
|
<% end %>
|
84
121
|
<% end %>
|