govuk_publishing_components 21.60.1 → 21.63.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 (53) 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/lib/govspeak/youtube-link-enhancement.js +1 -1
  5. data/app/assets/javascripts/govuk_publishing_components/vendor/html5shiv-printshiv.js +4 -0
  6. data/app/assets/javascripts/govuk_publishing_components/vendor/json2.js +487 -0
  7. data/app/assets/stylesheets/component_guide/application.scss +4 -0
  8. data/app/assets/stylesheets/govuk_publishing_components/_all_components.scss +1 -0
  9. data/app/assets/stylesheets/govuk_publishing_components/components/_breadcrumbs.scss +3 -16
  10. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-footer.scss +8 -0
  11. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-for-public.scss +4 -0
  12. data/app/assets/stylesheets/govuk_publishing_components/components/_layout-header.scss +87 -1
  13. data/app/assets/stylesheets/govuk_publishing_components/components/_radio.scss +1 -1
  14. data/app/assets/stylesheets/govuk_publishing_components/components/_search.scss +46 -0
  15. data/app/assets/stylesheets/govuk_publishing_components/govuk_frontend_support.scss +8 -0
  16. data/app/models/govuk_publishing_components/audit_applications.rb +35 -23
  17. data/app/models/govuk_publishing_components/audit_comparer.rb +13 -0
  18. data/app/models/govuk_publishing_components/component_example.rb +4 -0
  19. data/app/views/govuk_publishing_components/audit/show.html.erb +32 -3
  20. data/app/views/govuk_publishing_components/component_guide/component_doc/_component.html.erb +1 -0
  21. data/app/views/govuk_publishing_components/components/_breadcrumbs.html.erb +1 -1
  22. data/app/views/govuk_publishing_components/components/_document_list.html.erb +18 -9
  23. data/app/views/govuk_publishing_components/components/_image_card.html.erb +1 -1
  24. data/app/views/govuk_publishing_components/components/_layout_footer.html.erb +32 -21
  25. data/app/views/govuk_publishing_components/components/_layout_for_public.html.erb +76 -0
  26. data/app/views/govuk_publishing_components/components/_layout_header.html.erb +39 -51
  27. data/app/views/govuk_publishing_components/components/_search.html.erb +10 -5
  28. data/app/views/govuk_publishing_components/components/_share_links.html.erb +9 -9
  29. data/app/views/govuk_publishing_components/components/docs/document_list.yml +18 -0
  30. data/app/views/govuk_publishing_components/components/docs/image_card.yml +13 -1
  31. data/app/views/govuk_publishing_components/components/docs/layout_footer.yml +17 -0
  32. data/app/views/govuk_publishing_components/components/docs/layout_for_admin.yml +5 -1
  33. data/app/views/govuk_publishing_components/components/docs/layout_for_public.yml +29 -0
  34. data/app/views/govuk_publishing_components/components/docs/layout_header.yml +34 -0
  35. data/app/views/govuk_publishing_components/components/docs/search.yml +6 -0
  36. data/app/views/govuk_publishing_components/components/feedback/_problem_form.html.erb +6 -6
  37. data/app/views/govuk_publishing_components/components/feedback/_survey_signup_form.html.erb +6 -6
  38. data/app/views/govuk_publishing_components/components/feedback/_yes_no_banner.html.erb +8 -10
  39. data/app/views/govuk_publishing_components/components/layout_header/_header_logo.html.erb +23 -0
  40. data/app/views/govuk_publishing_components/components/layout_header/_navigation_items.html.erb +17 -0
  41. data/app/views/govuk_publishing_components/components/layout_header/_search.html.erb +9 -0
  42. data/config/initializers/assets.rb +8 -0
  43. data/config/locales/en.yml +18 -0
  44. data/lib/govuk_publishing_components.rb +1 -0
  45. data/lib/govuk_publishing_components/presenters/breadcrumb_selector.rb +5 -0
  46. data/lib/govuk_publishing_components/presenters/content_breadcrumbs_based_on_priority.rb +1 -0
  47. data/lib/govuk_publishing_components/presenters/image_card_helper.rb +3 -2
  48. data/lib/govuk_publishing_components/presenters/public_layout_helper.rb +380 -0
  49. data/lib/govuk_publishing_components/version.rb +1 -1
  50. data/node_modules/govuk-frontend/govuk/components/character-count/_index.scss +0 -4
  51. data/node_modules/govuk-frontend/govuk/settings/_colours-palette.scss +33 -33
  52. data/node_modules/govuk-frontend/package.json +1 -1
  53. metadata +12 -2
@@ -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
@@ -10,7 +10,7 @@
10
10
  data-track-action="GOV.UK Close Form"
11
11
  aria-controls="something-is-wrong"
12
12
  aria-expanded="true"
13
- role="button">Close</a>
13
+ role="button"><%= t("components.feedback.close", default: "Close") %></a>
14
14
 
15
15
  <div class="govuk-grid-row">
16
16
  <div class="govuk-grid-column-two-thirds">
@@ -18,12 +18,12 @@
18
18
 
19
19
  <input type="hidden" name="url" value="<%= url_without_pii %>">
20
20
 
21
- <h3 class="gem-c-feedback__form-heading">Help us improve GOV.UK</h3>
22
- <p id="feedback_explanation" class="gem-c-feedback__form-paragraph">Don’t include personal or financial information like your National Insurance number or credit card details.</p>
21
+ <h3 class="gem-c-feedback__form-heading"><%= t("components.feedback.help_us_improve_govuk", default: "Help us improve GOV.UK") %></h3>
22
+ <p id="feedback_explanation" class="gem-c-feedback__form-paragraph"><%= t("components.feedback.dont_include_personal_info", default: "Don’t include personal or financial information like your National Insurance number or credit card details.") %></p>
23
23
 
24
24
  <%= render "govuk_publishing_components/components/input", {
25
25
  label: {
26
- text: "What were you doing?"
26
+ text: t("components.feedback.what_doing", default: "What were you doing?")
27
27
  },
28
28
  name: "what_doing",
29
29
  describedby: "feedback_explanation"
@@ -31,13 +31,13 @@
31
31
 
32
32
  <%= render "govuk_publishing_components/components/input", {
33
33
  label: {
34
- text: "What went wrong?"
34
+ text: t("components.feedback.what_wrong", default: "What went wrong?")
35
35
  },
36
36
  name: "what_wrong"
37
37
  } %>
38
38
 
39
39
  <%= render "govuk_publishing_components/components/button", {
40
- text: "Send"
40
+ text: t("components.feedback.send", default: "Send")
41
41
  } %>
42
42
  </div>
43
43
  </div>
@@ -10,7 +10,7 @@
10
10
  data-track-action="ffFormClose"
11
11
  aria-controls="page-is-not-useful"
12
12
  aria-expanded="true"
13
- role="button">Close</a>
13
+ role="button"><%= t("components.feedback.close", default: "Close") %></a>
14
14
 
15
15
  <div class="govuk-grid-row">
16
16
  <div class="govuk-grid-column-two-thirds" id="survey-wrapper">
@@ -19,12 +19,12 @@
19
19
  <input name="email_survey_signup[survey_id]" type="hidden" value="footer_satisfaction_survey">
20
20
  <input name="email_survey_signup[survey_source]" type="hidden" value="<%= path_without_pii %>">
21
21
 
22
- <h3 class="gem-c-feedback__form-heading">Help us improve GOV.UK</h3>
23
- <p id="survey_explanation" class="gem-c-feedback__form-paragraph">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.</p>
22
+ <h3 class="gem-c-feedback__form-heading"><%= t("components.feedback.help_us_improve_govuk", default: "Help us improve GOV.UK") %></h3>
23
+ <p id="survey_explanation" class="gem-c-feedback__form-paragraph"><%= t("components.feedback.more_about_visit", default: "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.") %></p>
24
24
 
25
25
  <%= render "govuk_publishing_components/components/input", {
26
26
  label: {
27
- text: "Email address"
27
+ text: t("components.feedback.email_address", default: "Email address")
28
28
  },
29
29
  name: "email_survey_signup[email_address]",
30
30
  type: "email",
@@ -32,8 +32,8 @@
32
32
  describedby: "survey_explanation"
33
33
  } %>
34
34
 
35
- <%= render "govuk_publishing_components/components/button", {
36
- text: "Send me the survey",
35
+ <%= render "govuk_publishing_components/components/button", {
36
+ text: t("components.feedback.send_me_survey", default: "Send me the survey"),
37
37
  } %>
38
38
  </div>
39
39
  </div>
@@ -4,9 +4,9 @@
4
4
 
5
5
  <div class="gem-c-feedback__prompt gem-c-feedback__js-show js-prompt" tabindex="-1">
6
6
  <div class="gem-c-feedback__prompt-questions js-prompt-questions">
7
- <h2 class="gem-c-feedback__prompt-question">Is this page useful?</h2>
7
+ <h2 class="gem-c-feedback__prompt-question"><%= t("components.feedback.is_this_page_useful", default: "Is this page useful?") %></h2>
8
8
  <!-- Maybe button exists only to try and capture clicks by bots -->
9
- <%= link_to contact_govuk_path, {
9
+ <%= link_to t("components.feedback.maybe", default: "Maybe"), contact_govuk_path, {
10
10
  class: 'gem-c-feedback__prompt-link',
11
11
  data: {
12
12
  'track-category' => 'yesNoFeedbackForm',
@@ -17,9 +17,7 @@
17
17
  style: 'display: none;',
18
18
  hidden: 'hidden',
19
19
  'aria-hidden': 'true',
20
- } do %>
21
- Maybe
22
- <% end %>
20
+ } %>
23
21
  <ul class="gem-c-feedback__option-list">
24
22
  <li class="gem-c-feedback__option-list-item">
25
23
  <%= link_to contact_govuk_path, {
@@ -31,7 +29,7 @@
31
29
  'aria-expanded': false,
32
30
  role: 'button',
33
31
  } do %>
34
- Yes <span class="govuk-visually-hidden">this page is useful</span>
32
+ <%= t("components.feedback.yes", default: "Yes") %> <span class="govuk-visually-hidden"><%= t("components.feedback.is_useful", default: "this page is useful") %></span>
35
33
  <% end %>
36
34
  </li>
37
35
  <li class="gem-c-feedback__option-list-item">
@@ -45,13 +43,13 @@
45
43
  'aria-expanded': false,
46
44
  role: 'button',
47
45
  } do %>
48
- No <span class="govuk-visually-hidden">this page is not useful</span>
46
+ <%= t("components.feedback.no", default: "No") %> <span class="govuk-visually-hidden"><%= t("components.feedback.is_not_useful", default: "this page is not useful") %></span>
49
47
  <% end %>
50
48
  </li>
51
49
  </ul>
52
50
  </div>
53
- <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-success js-prompt-success js-hidden" tabindex="-1">
54
- Thank you for your feedback
51
+ <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-success js-prompt-success js-hidden" role="alert">
52
+ <%= t("components.feedback.thank_you_for_feedback", default: "Thank you for your feedback") %>
55
53
  </div>
56
54
  <div class="gem-c-feedback__prompt-questions gem-c-feedback__prompt-questions--something-is-wrong js-prompt-questions">
57
55
  <%= link_to contact_govuk_path, {
@@ -64,7 +62,7 @@
64
62
  'aria-expanded': false,
65
63
  role: 'button',
66
64
  } do %>
67
- Is there anything wrong with this page?
65
+ <%= t("components.feedback.anything_wrong", default: "Is there anything wrong with this page?") %>
68
66
  <% end %>
69
67
  </div>
70
68
  </div>
@@ -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[
@@ -36,6 +36,24 @@ en:
36
36
  or: 'or'
37
37
  contents_list:
38
38
  contents: Contents
39
+ feedback:
40
+ is_this_page_useful: "Is this page useful?"
41
+ yes: "Yes"
42
+ no: "No"
43
+ maybe: "Maybe"
44
+ is_useful: "this page is useful"
45
+ is_not_useful: "this page is not useful"
46
+ thank_you_for_feedback: "Thank you for your feedback"
47
+ anything_wrong: "Is there anything wrong with this page?"
48
+ close: "Close"
49
+ help_us_improve_govuk: "Help us improve GOV.UK"
50
+ 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."
51
+ dont_include_personal_info: "Don’t include personal or financial information like your National Insurance number or credit card details."
52
+ email_address: "Email address"
53
+ what_doing: "What were you doing?"
54
+ what_wrong: "What went wrong?"
55
+ send_me_survey: "Send me the survey"
56
+ send: "Send"
39
57
  organisation_schema:
40
58
  all_content_search_description: "Find all content from %{organisation}"
41
59
  radio:
@@ -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"
@@ -18,6 +18,7 @@ module GovukPublishingComponents
18
18
  end
19
19
 
20
20
  def priority_breadcrumbs
21
+ return if hide_priority_breadcrumb?
21
22
  return parent_item_navigation.priority_breadcrumbs if content_item_navigation.html_publication_with_parent?
22
23
 
23
24
  content_item_navigation.priority_breadcrumbs
@@ -25,6 +26,10 @@ module GovukPublishingComponents
25
26
 
26
27
  private
27
28
 
29
+ def hide_priority_breadcrumb?
30
+ content_item_navigation.content_tagged_to_current_step_by_step? && content_item_navigation.tagged_to_brexit?
31
+ end
32
+
28
33
  def best_match_option
29
34
  return content_item_options unless content_item_navigation.html_publication_with_parent?
30
35
 
@@ -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
@@ -4,7 +4,7 @@ module GovukPublishingComponents
4
4
  include ActionView::Helpers
5
5
  include ActionView::Context
6
6
 
7
- attr_reader :href, :href_data_attributes, :extra_links, :large, :extra_links_no_indent, :heading_text, :metadata
7
+ attr_reader :href, :href_data_attributes, :extra_links, :large, :extra_links_no_indent, :heading_text, :metadata, :lang
8
8
 
9
9
  def initialize(local_assigns)
10
10
  @href = local_assigns[:href]
@@ -18,6 +18,7 @@ module GovukPublishingComponents
18
18
  @heading_text = local_assigns[:heading_text]
19
19
  @extra_links_no_indent = local_assigns[:extra_links_no_indent]
20
20
  @metadata = local_assigns[:metadata]
21
+ @lang = local_assigns[:lang]
21
22
  end
22
23
 
23
24
  def is_tracking?
@@ -44,7 +45,7 @@ module GovukPublishingComponents
44
45
 
45
46
  content_tag(:p, class: "gem-c-image-card__context") do
46
47
  if @context[:date]
47
- 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")
48
49
  dash = content_tag(:span, " — ", 'aria-hidden': true)
49
50
 
50
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