govuk_publishing_components 21.60.3 → 21.61.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.
Files changed (35) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/govuk_publishing_components/components/checkboxes.js +102 -73
  3. data/app/assets/javascripts/govuk_publishing_components/ie.js +2 -0
  4. data/app/assets/javascripts/govuk_publishing_components/vendor/html5shiv-printshiv.js +4 -0
  5. data/app/assets/javascripts/govuk_publishing_components/vendor/json2.js +487 -0
  6. data/app/assets/stylesheets/component_guide/application.scss +4 -0
  7. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +8 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +4 -0
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +87 -1
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +46 -0
  12. data/app/models/govuk_publishing_components/component_example.rb +4 -0
  13. data/app/views/govuk_publishing_components/component_guide/component_doc/_component.html.erb +1 -0
  14. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +32 -21
  15. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +76 -0
  16. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +39 -51
  17. data/app/views/govuk_publishing_components/components/_search.html.erb +10 -5
  18. data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +17 -0
  19. data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +5 -1
  20. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +29 -0
  21. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +34 -0
  22. data/app/views/govuk_publishing_components/components/docs/search.yml +6 -0
  23. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +23 -0
  24. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +17 -0
  25. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +9 -0
  26. data/config/initializers/assets.rb +8 -0
  27. data/lib/govuk_publishing_components.rb +1 -0
  28. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +1 -0
  29. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +1 -1
  30. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +380 -0
  31. data/lib/govuk_publishing_components/version.rb +1 -1
  32. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +0 -4
  33. data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +33 -33
  34. data/node_modules/govuk-frontend/package.json +1 -1
  35. metadata +12 -2
@@ -1,9 +1,14 @@
1
1
  <%
2
- class_name = "gem-c-search--on-white"
3
- class_name = "gem-c-search--on-govuk-blue" if local_assigns[:on_govuk_blue].eql?(true)
4
2
  size ||= ""
5
- class_name = "#{class_name} gem-c-search--large" if size == 'large'
6
- class_name = "#{class_name} gem-c-search--separate-label" if local_assigns.include?(:inline_label)
3
+ no_border ||= false
4
+ shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
5
+ classes = %w(gem-c-search gem-c-search--on-white)
6
+ classes << (shared_helper.get_margin_top)
7
+ classes << (shared_helper.get_margin_bottom) if local_assigns[:margin_bottom]
8
+ classes << "gem-c-search--large" if size == 'large'
9
+ classes << "gem-c-search--no-border" if no_border
10
+ classes << "gem-c-search--on-govuk-blue" if local_assigns[:on_govuk_blue].eql?(true)
11
+ classes << "gem-c-search--separate-label" if local_assigns.include?(:inline_label)
7
12
 
8
13
  value ||= ""
9
14
  id ||= "search-main-" + SecureRandom.hex(4)
@@ -12,7 +17,7 @@
12
17
  aria_controls ||= nil
13
18
  %>
14
19
 
15
- <div class="gem-c-search <%= class_name %>" data-module="gem-toggle-input-class-on-focus">
20
+ <div class="<%= classes.join(' ') %>" data-module="gem-toggle-input-class-on-focus">
16
21
  <label for="<%= id %>" class="gem-c-search__label">
17
22
  <%= label_text %>
18
23
  </label>
@@ -139,3 +139,20 @@ examples:
139
139
  attributes:
140
140
  lang: en
141
141
  hreflang: en
142
+ with_border:
143
+ data:
144
+ with_border: true
145
+ meta:
146
+ items:
147
+ - href: '/help'
148
+ text: Help
149
+ - href: '/help/cookies'
150
+ text: Cookies
151
+ - href: '/contact'
152
+ text: Contact
153
+ - href: '/help/terms-conditions'
154
+ text: Terms and conditions
155
+ - href: '/cymraeg'
156
+ text: Rhestr o Wasanaethau Cymraeg
157
+ - href: '/government/organisations/government-digital-service'
158
+ text: Government Digital Service
@@ -10,7 +10,11 @@ body: |
10
10
  display_preview: false
11
11
  display_html: true
12
12
  accessibility_criteria: |
13
- TBD
13
+ The layout template must:
14
+
15
+ * have a `lang` attribute
16
+ * contain a [skip link](/component-guide/skip_link)
17
+ * have a sensible page `<title>`
14
18
  examples:
15
19
  default:
16
20
  data:
@@ -0,0 +1,29 @@
1
+ name: Public layout
2
+ description: A layout to be used by public-facing applications
3
+ body: |
4
+ Because it is an entire HTML document, this component can only be [previewed on a separate page](/public).
5
+
6
+ display_preview: false
7
+ display_html: true
8
+ accessibility_criteria: |
9
+ The layout template must:
10
+
11
+ * have a `lang` attribute
12
+ * contain a [skip link](/component-guide/skip_link)
13
+ * have a sensible page `<title>`
14
+ examples:
15
+ default:
16
+ data:
17
+ title: 'Example layout'
18
+ block: |
19
+ <h1>Page content goes here</h1>
20
+ full_width:
21
+ description: By default, the layout applies the `govuk-width-container` class to the main element. We can remove this class by setting `full_width` to `true`
22
+ data:
23
+ full_width: true
24
+ block: |
25
+ <h1>Page content goes here</h1>
26
+ omit_header:
27
+ description: This allows the header to be omitted which is currently used when rendering CSV previews from Whitehall
28
+ data:
29
+ omit_header: true
@@ -7,6 +7,10 @@ govuk_frontend_components:
7
7
  - header
8
8
  accessibility_excluded_rules:
9
9
  - landmark-banner-is-top-level # The header element can not be top level in the examples
10
+ - duplicate-id-aria # IDs will be duplicated in component examples list
11
+ - form-field-multiple-labels # Form labels will be ambiguous in component examples list
12
+ - landmark-no-duplicate-banner # banners will be duplicated in component examples list
13
+ - landmark-unique # aria-label attributes will be duplicated in component examples list
10
14
  examples:
11
15
  default:
12
16
  data:
@@ -36,12 +40,42 @@ examples:
36
40
  - text: Hidden on desktop
37
41
  href: "item-3"
38
42
  show_only_in_collapsed_menu: true
43
+ with_left_search_and_navigation:
44
+ description: This supports pages where the search appears on the left with multiple navigation links on the right, such as the [How government works](https://www.gov.uk/government/how-government-works) page
45
+ data:
46
+ search_left: true
47
+ environment: public
48
+ navigation_items:
49
+ - text: Departments
50
+ href: "item-1"
51
+ - text: Worldwide
52
+ href: "item-2"
53
+ - text: How government works
54
+ href: "item-3"
55
+ - text: Get involved
56
+ href: "item-4"
57
+ - text: Consultations
58
+ href: "item-4"
59
+ - text: Statistics
60
+ href: "item-5"
61
+ - text: News and communications
62
+ href: "item-6"
63
+ active: true
39
64
  full_width:
40
65
  description: |
41
66
  This is difficult to preview because the preview windows are constrained, but the header will stretch to the size of its container.
42
67
  data:
43
68
  environment: production
44
69
  full_width: true
70
+ no_bottom_border:
71
+ description: This is useful for pages where a large full-width banner is the first thing to appear on the page, for example, the [GOV.UK homepage](https://www.gov.uk)
72
+ data:
73
+ remove_bottom_border: true
74
+ environment: 'public'
75
+ with_search_bar:
76
+ data:
77
+ environment: 'public'
78
+ search: true
45
79
 
46
80
  accessibility_criteria: |
47
81
  The component must:
@@ -24,6 +24,12 @@ examples:
24
24
  stop_the_label_appearing_inline:
25
25
  data:
26
26
  inline_label: false
27
+ no_border:
28
+ description: Sometimes we don't need the grey border surrounding the input field, such as when the component is used on a black background
29
+ data:
30
+ no_border: true
31
+ context:
32
+ black_background: true
27
33
  for_use_on_govuk_blue_background:
28
34
  data:
29
35
  on_govuk_blue: true
@@ -0,0 +1,23 @@
1
+ <div class="govuk-header__logo gem-c-header__logo">
2
+ <a href="/" class="govuk-header__link govuk-header__link--homepage" data-module="track-click" data-track-category="homeLinkClicked" data-track-action="homeHeader">
3
+ <span class="govuk-header__logotype">
4
+ <svg aria-hidden="true" focusable="false" class="govuk-header__logotype-crown" xmlns="http://www.w3.org/2000/svg" viewbox="0 0 132 97" height="32" width="36">
5
+ <path fill="currentColor" fill-rule="evenodd"
6
+ d="M25 30.2c3.5 1.5 7.7-.2 9.1-3.7 1.5-3.6-.2-7.8-3.9-9.2-3.6-1.4-7.6.3-9.1 3.9-1.4 3.5.3 7.5 3.9 9zM9 39.5c3.6 1.5 7.8-.2 9.2-3.7 1.5-3.6-.2-7.8-3.9-9.1-3.6-1.5-7.6.2-9.1 3.8-1.4 3.5.3 7.5 3.8 9zM4.4 57.2c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.5-1.5-7.6.3-9.1 3.8-1.4 3.5.3 7.6 3.9 9.1zm38.3-21.4c3.5 1.5 7.7-.2 9.1-3.8 1.5-3.6-.2-7.7-3.9-9.1-3.6-1.5-7.6.3-9.1 3.8-1.3 3.6.4 7.7 3.9 9.1zm64.4-5.6c-3.6 1.5-7.8-.2-9.1-3.7-1.5-3.6.2-7.8 3.8-9.2 3.6-1.4 7.7.3 9.2 3.9 1.3 3.5-.4 7.5-3.9 9zm15.9 9.3c-3.6 1.5-7.7-.2-9.1-3.7-1.5-3.6.2-7.8 3.7-9.1 3.6-1.5 7.7.2 9.2 3.8 1.5 3.5-.3 7.5-3.8 9zm4.7 17.7c-3.6 1.5-7.8-.2-9.2-3.8-1.5-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.3 3.5-.4 7.6-3.9 9.1zM89.3 35.8c-3.6 1.5-7.8-.2-9.2-3.8-1.4-3.6.2-7.7 3.9-9.1 3.6-1.5 7.7.3 9.2 3.8 1.4 3.6-.3 7.7-3.9 9.1zM69.7 17.7l8.9 4.7V9.3l-8.9 2.8c-.2-.3-.5-.6-.9-.9L72.4 0H59.6l3.5 11.2c-.3.3-.6.5-.9.9l-8.8-2.8v13.1l8.8-4.7c.3.3.6.7.9.9l-5 15.4v.1c-.2.8-.4 1.6-.4 2.4 0 4.1 3.1 7.5 7 8.1h.2c.3 0 .7.1 1 .1.4 0 .7 0 1-.1h.2c4-.6 7.1-4.1 7.1-8.1 0-.8-.1-1.7-.4-2.4V34l-5.1-15.4c.4-.2.7-.6 1-.9zM66 92.8c16.9 0 32.8 1.1 47.1 3.2 4-16.9 8.9-26.7 14-33.5l-9.6-3.4c1 4.9 1.1 7.2 0 10.2-1.5-1.4-3-4.3-4.2-8.7L108.6 76c2.8-2 5-3.2 7.5-3.3-4.4 9.4-10 11.9-13.6 11.2-4.3-.8-6.3-4.6-5.6-7.9 1-4.7 5.7-5.9 8-.5 4.3-8.7-3-11.4-7.6-8.8 7.1-7.2 7.9-13.5 2.1-21.1-8 6.1-8.1 12.3-4.5 20.8-4.7-5.4-12.1-2.5-9.5 6.2 3.4-5.2 7.9-2 7.2 3.1-.6 4.3-6.4 7.8-13.5 7.2-10.3-.9-10.9-8-11.2-13.8 2.5-.5 7.1 1.8 11 7.3L80.2 60c-4.1 4.4-8 5.3-12.3 5.4 1.4-4.4 8-11.6 8-11.6H55.5s6.4 7.2 7.9 11.6c-4.2-.1-8-1-12.3-5.4l1.4 16.4c3.9-5.5 8.5-7.7 10.9-7.3-.3 5.8-.9 12.8-11.1 13.8-7.2.6-12.9-2.9-13.5-7.2-.7-5 3.8-8.3 7.1-3.1 2.7-8.7-4.6-11.6-9.4-6.2 3.7-8.5 3.6-14.7-4.6-20.8-5.8 7.6-5 13.9 2.2 21.1-4.7-2.6-11.9.1-7.7 8.8 2.3-5.5 7.1-4.2 8.1.5.7 3.3-1.3 7.1-5.7 7.9-3.5.7-9-1.8-13.5-11.2 2.5.1 4.7 1.3 7.5 3.3l-4.7-15.4c-1.2 4.4-2.7 7.2-4.3 8.7-1.1-3-.9-5.3 0-10.2l-9.5 3.4c5 6.9 9.9 16.7 14 33.5 14.8-2.1 30.8-3.2 47.7-3.2z"></path>
7
+ <%# Deliberate use of image tag as a fallback method https://lynn.ru/examples/svg/en.html %>
8
+ <image src="<%= asset_path('govuk-logotype-crown.png') %>" class="govuk-header__logotype-crown-fallback-image"></image>
9
+ </svg>
10
+ <span class="govuk-header__logotype-text">
11
+ GOV.UK
12
+ </span>
13
+ </span>
14
+ <% unless public_environment %>
15
+ <span class="govuk-header__product-name gem-c-header__product-name">
16
+ <%= product_name %>
17
+ </span>
18
+ <span class="gem-c-environment-tag govuk-tag gem-c-environment-tag--<%= environment %>">
19
+ <%= environment %>
20
+ </span>
21
+ <% end %>
22
+ </a>
23
+ </div>
@@ -0,0 +1,17 @@
1
+ <% if navigation_items.any? %>
2
+ <button role="button" class="govuk-header__menu-button gem-c-header__menu-button govuk-js-header-toggle" aria-controls="navigation" aria-label="Show or hide Top Level Navigation">Menu</button>
3
+ <nav class="gem-c-header__nav">
4
+ <ul id="navigation" class="govuk-header__navigation govuk-header__navigation--end" aria-label="Top Level Navigation">
5
+ <% navigation_items.each_with_index do |item, index| %>
6
+ <li class="govuk-header__navigation-item <%= "govuk-header__navigation-item--active" if item[:active] %>
7
+ <%= "govuk-header__navigation-item--collapsed-menu-only" if item[:show_only_in_collapsed_menu] %>">
8
+ <%= link_to(
9
+ item[:text],
10
+ item[:href],
11
+ class: 'govuk-header__link',
12
+ ) %>
13
+ </li>
14
+ <% end %>
15
+ </ul>
16
+ </nav>
17
+ <% end %>
@@ -0,0 +1,9 @@
1
+ <a href="#search" class="search-toggle js-header-toggle">Search</a>
2
+ <form id="search" class="gem-c-layout-header__search-form govuk-clearfix" action="/search" method="get" role="search">
3
+ <%= render "govuk_publishing_components/components/search", {
4
+ id: "site-search-text",
5
+ label_text: "Search",
6
+ no_border: true,
7
+ margin_bottom: 0
8
+ } %>
9
+ </form>
@@ -8,6 +8,7 @@ Rails.application.config.assets.precompile += %w[
8
8
  component_guide/visual-regression.js
9
9
  component_guide/print.css
10
10
  govuk_publishing_components/all_components.js
11
+ govuk_publishing_components/ie.js
11
12
  govuk_publishing_components/modules.js
12
13
  govuk_publishing_components/vendor/modernizr.js
13
14
  govuk_publishing_components/component_guide.css
@@ -30,6 +31,13 @@ Rails.application.config.assets.precompile += %w[
30
31
  # GOV.UK Frontend assets
31
32
  Rails.application.config.assets.precompile += %w[
32
33
  govuk-logotype-crown.png
34
+ favicon.ico
35
+ govuk-opengraph-image.png
36
+ govuk-mask-icon.svg
37
+ govuk-apple-touch-icon-180x180.png
38
+ govuk-apple-touch-icon-167x167.png
39
+ govuk-apple-touch-icon-152x152.png
40
+ govuk-apple-touch-icon.png
33
41
  ]
34
42
 
35
43
  Rails.application.config.assets.paths += %W[
@@ -12,6 +12,7 @@ require "govuk_publishing_components/presenters/contextual_navigation"
12
12
  require "govuk_publishing_components/presenters/related_navigation_helper"
13
13
  require "govuk_publishing_components/presenters/step_by_step_nav_helper"
14
14
  require "govuk_publishing_components/presenters/page_with_step_by_step_navigation"
15
+ require "govuk_publishing_components/presenters/public_layout_helper"
15
16
  require "govuk_publishing_components/presenters/content_breadcrumbs_based_on_ancestors"
16
17
  require "govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority"
17
18
  require "govuk_publishing_components/presenters/content_breadcrumbs_based_on_taxons"
@@ -8,6 +8,7 @@ module GovukPublishingComponents
8
8
  education_coronavirus: "272308f4-05c8-4d0d-abc7-b7c2e3ccd249",
9
9
  worker_coronavirus: "b7f57213-4b16-446d-8ded-81955d782680",
10
10
  business_coronavirus: "65666cdf-b177-4d79-9687-b9c32805e450",
11
+ transition_period: "d6c2de5d-ef90-45d1-82d4-5f2438369eea",
11
12
  }.freeze
12
13
 
13
14
  # Returns the highest priority taxon that has a content_id matching those in PRIORITY_TAXONS
@@ -45,7 +45,7 @@ module GovukPublishingComponents
45
45
 
46
46
  content_tag(:p, class: "gem-c-image-card__context") do
47
47
  if @context[:date]
48
- date = content_tag(:time, l(@context[:date], format: "%e %B %Y"), datetime: @context[:date].iso8601)
48
+ date = content_tag(:time, l(@context[:date], format: "%e %B %Y"), datetime: @context[:date].iso8601, lang: "en")
49
49
  dash = content_tag(:span, " — ", 'aria-hidden': true)
50
50
 
51
51
  if @context[:text]
@@ -0,0 +1,380 @@
1
+ module GovukPublishingComponents
2
+ module Presenters
3
+ class PublicLayoutHelper
4
+ FOOTER_NAV = [
5
+ {
6
+ title: "Prepare for Brexit",
7
+ columns: 2,
8
+ items: [
9
+ {
10
+ href: "/business-uk-leaving-eu",
11
+ text: "Prepare your business or organisation for Brexit",
12
+ attributes: {
13
+ data: {
14
+ track_category: "footerClicked",
15
+ track_action: "brexitLinks",
16
+ track_label: "Prepare your business or organisation for the UK leaving the EU",
17
+ },
18
+ },
19
+ },
20
+ {
21
+ href: "/prepare-eu-exit",
22
+ text: "Prepare for Brexit if you live in the UK",
23
+ attributes: {
24
+ data: {
25
+ track_category: "footerClicked",
26
+ track_action: "brexitLinks",
27
+ track_label: "Prepare for Brexit if you live in the UK",
28
+ },
29
+ },
30
+ },
31
+ {
32
+ href: "/uk-nationals-living-eu",
33
+ text: "Living in Europe after Brexit",
34
+ attributes: {
35
+ data: {
36
+ track_category: "footerClicked",
37
+ track_action: "brexitLinks",
38
+ track_label: "Living in Europe after Brexit",
39
+ },
40
+ },
41
+ },
42
+ {
43
+ href: "/staying-uk-eu-citizen",
44
+ text: "Continue to live in the UK after Brexit",
45
+ attributes: {
46
+ data: {
47
+ track_category: "footerClicked",
48
+ track_action: "brexitLinks",
49
+ track_label: "Continue to live in the UK after Brexit",
50
+ },
51
+ },
52
+ },
53
+ ],
54
+ },
55
+ {
56
+ title: "Services and information",
57
+ columns: 2,
58
+ items: [
59
+ {
60
+ href: "/browse/benefits",
61
+ text: "Benefits",
62
+ attributes: {
63
+ data: {
64
+ track_category: "footerClicked",
65
+ track_action: "footerLinks",
66
+ track_label: "Benefits",
67
+ },
68
+ },
69
+ },
70
+ {
71
+ href: "/browse/births-deaths-marriages",
72
+ text: "Births, deaths, marriages and care",
73
+ attributes: {
74
+ data: {
75
+ track_category: "footerClicked",
76
+ track_action: "footerLinks",
77
+ track_label: "Births, deaths, marriages and care",
78
+ },
79
+ },
80
+ },
81
+ {
82
+ href: "/browse/business",
83
+ text: "Business and self-employed",
84
+ attributes: {
85
+ data: {
86
+ track_category: "footerClicked",
87
+ track_action: "footerLinks",
88
+ track_label: "Business and self-employed",
89
+ },
90
+ },
91
+ },
92
+ {
93
+ href: "/browse/childcare-parenting",
94
+ text: "Childcare and parenting",
95
+ attributes: {
96
+ data: {
97
+ track_category: "footerClicked",
98
+ track_action: "footerLinks",
99
+ track_label: "Childcare and parenting",
100
+ },
101
+ },
102
+ },
103
+ {
104
+ href: "/browse/citizenship",
105
+ text: "Citizenship and living in the UK",
106
+ attributes: {
107
+ data: {
108
+ track_category: "footerClicked",
109
+ track_action: "footerLinks",
110
+ track_label: "Citizenship and living in the UK",
111
+ },
112
+ },
113
+ },
114
+ {
115
+ href: "/browse/justice",
116
+ text: "Crime, justice and the law",
117
+ attributes: {
118
+ data: {
119
+ track_category: "footerClicked",
120
+ track_action: "footerLinks",
121
+ track_label: "Crime, justice and the law",
122
+ },
123
+ },
124
+ },
125
+ {
126
+ href: "/browse/disabilities",
127
+ text: "Disabled people",
128
+ attributes: {
129
+ data: {
130
+ track_category: "footerClicked",
131
+ track_action: "footerLinks",
132
+ track_label: "Disabled people",
133
+ },
134
+ },
135
+ },
136
+ {
137
+ href: "/browse/driving",
138
+ text: "Driving and transport",
139
+ attributes: {
140
+ data: {
141
+ track_category: "footerClicked",
142
+ track_action: "footerLinks",
143
+ track_label: "Driving and transport",
144
+ },
145
+ },
146
+ },
147
+ {
148
+ href: "/browse/education",
149
+ text: "Education and learning",
150
+ attributes: {
151
+ data: {
152
+ track_category: "footerClicked",
153
+ track_action: "footerLinks",
154
+ track_label: "Education and learning",
155
+ },
156
+ },
157
+ },
158
+ {
159
+ href: "/browse/employing-people",
160
+ text: "Employing people",
161
+ attributes: {
162
+ data: {
163
+ track_category: "footerClicked",
164
+ track_action: "footerLinks",
165
+ track_label: "Employing people",
166
+ },
167
+ },
168
+ },
169
+ {
170
+ href: "/browse/environment-countryside",
171
+ text: "Environment and countryside",
172
+ attributes: {
173
+ data: {
174
+ track_category: "footerClicked",
175
+ track_action: "footerLinks",
176
+ track_label: "Environment and countryside",
177
+ },
178
+ },
179
+ },
180
+ {
181
+ href: "/browse/housing-local-services",
182
+ text: "Housing and local services",
183
+ attributes: {
184
+ data: {
185
+ track_category: "footerClicked",
186
+ track_action: "footerLinks",
187
+ track_label: "Housing and local services",
188
+ },
189
+ },
190
+ },
191
+ {
192
+ href: "/browse/tax",
193
+ text: "Money and tax",
194
+ attributes: {
195
+ data: {
196
+ track_category: "footerClicked",
197
+ track_action: "footerLinks",
198
+ track_label: "Money and tax",
199
+ },
200
+ },
201
+ },
202
+ {
203
+ href: "/browse/abroad",
204
+ text: "Passports, travel and living abroad",
205
+ attributes: {
206
+ data: {
207
+ track_category: "footerClicked",
208
+ track_action: "footerLinks",
209
+ track_label: "Passports, travel and living abroad",
210
+ },
211
+ },
212
+ },
213
+ {
214
+ href: "/browse/visas-immigration",
215
+ text: "Visas and immigration",
216
+ attributes: {
217
+ data: {
218
+ track_category: "footerClicked",
219
+ track_action: "footerLinks",
220
+ track_label: "Visas and immigration",
221
+ },
222
+ },
223
+ },
224
+ {
225
+ href: "/browse/working",
226
+ text: "Working, jobs and pensions",
227
+ attributes: {
228
+ data: {
229
+ track_category: "footerClicked",
230
+ track_action: "footerLinks",
231
+ track_label: "Working, jobs and pensions",
232
+ },
233
+ },
234
+ },
235
+ ],
236
+ },
237
+ {
238
+ title: "Departments and policy",
239
+ items: [
240
+ {
241
+ href: "/government/how-government-works",
242
+ text: "How government works",
243
+ attributes: {
244
+ data: {
245
+ track_category: "footerClicked",
246
+ track_action: "footerLinks",
247
+ track_label: "How government works",
248
+ },
249
+ },
250
+ },
251
+ {
252
+ href: "/government/organisations",
253
+ text: "Departments",
254
+ attributes: {
255
+ data: {
256
+ track_category: "footerClicked",
257
+ track_action: "footerLinks",
258
+ track_label: "Departments",
259
+ },
260
+ },
261
+ },
262
+ {
263
+ href: "/world",
264
+ text: "Worldwide",
265
+ attributes: {
266
+ data: {
267
+ track_category: "footerClicked",
268
+ track_action: "footerLinks",
269
+ track_label: "Worldwide",
270
+ },
271
+ },
272
+ },
273
+ {
274
+ href: "/search/services",
275
+ text: "Services",
276
+ attributes: {
277
+ data: {
278
+ track_category: "footerClicked",
279
+ track_action: "footerLinks",
280
+ track_label: "Services",
281
+ },
282
+ },
283
+ },
284
+ {
285
+ href: "/search/guidance-and-regulation",
286
+ text: "Guidance and regulation",
287
+ attributes: {
288
+ data: {
289
+ track_category: "footerClicked",
290
+ track_action: "footerLinks",
291
+ track_label: "Guidance and regulation",
292
+ },
293
+ },
294
+ },
295
+ {
296
+ href: "/search/news-and-communications",
297
+ text: "News and communications",
298
+ attributes: {
299
+ data: {
300
+ track_category: "footerClicked",
301
+ track_action: "footerLinks",
302
+ track_label: "News and communications",
303
+ },
304
+ },
305
+ },
306
+ {
307
+ href: "/search/research-and-statistics",
308
+ text: "Research and statistics",
309
+ attributes: {
310
+ data: {
311
+ track_category: "footerClicked",
312
+ track_action: "footerLinks",
313
+ track_label: "Research and statistics",
314
+ },
315
+ },
316
+ },
317
+ {
318
+ href: "/search/policy-papers-and-consultations",
319
+ text: "Policy papers and consultations",
320
+ attributes: {
321
+ data: {
322
+ track_category: "footerClicked",
323
+ track_action: "footerLinks",
324
+ track_label: "Policy papers and consultations",
325
+ },
326
+ },
327
+ },
328
+ {
329
+ href: "/search/transparency-and-freedom-of-information-releases",
330
+ text: "Transparency and freedom of information releases",
331
+ attributes: {
332
+ data: {
333
+ track_category: "footerClicked",
334
+ track_action: "footerLinks",
335
+ track_label: "Transparency and freedom of information releases",
336
+ },
337
+ },
338
+ },
339
+ ],
340
+ },
341
+ ].freeze
342
+
343
+ FOOTER_META = {
344
+ items: [
345
+ {
346
+ href: "/help",
347
+ text: "Help",
348
+ },
349
+ {
350
+ href: "/help/cookies",
351
+ text: "Cookies",
352
+ },
353
+ {
354
+ href: "/contact",
355
+ text: "Contact",
356
+ },
357
+ {
358
+ href: "/help/terms-conditions",
359
+ text: "Terms and conditions",
360
+ },
361
+ {
362
+ href: "/cymraeg",
363
+ text: "Rhestr o Wasanaethau Cymraeg",
364
+ },
365
+ {
366
+ href: "/government/organisations/government-digital-service",
367
+ text: "Government Digital Service",
368
+ },
369
+ ],
370
+ }.freeze
371
+
372
+ attr_reader :footer_navigation, :footer_meta
373
+
374
+ def initialize(local_assigns)
375
+ @footer_navigation = local_assigns[:footer_navigation] || FOOTER_NAV
376
+ @footer_meta = local_assigns[:footer_meta] || FOOTER_META
377
+ end
378
+ end
379
+ end
380
+ end