govuk_publishing_components 21.62.0 → 21.63.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d338f19f706ae958279f7217d7b10ae3f3939a0e9b850dc481b4a8878249ec53
4
- data.tar.gz: f9a356891d53fc81f49e2f467aefaa233947ebf501d27c1f5dd198574f2de370
3
+ metadata.gz: ca5313136ffde496204e61ad0ff9ac47a3a7fb9bb4b24a04698be2e64acd392f
4
+ data.tar.gz: 6d5956d2c5d2dceb4c7386c966b61cd3bb0201acfc591c13b1908a5cdeb0b840
5
5
  SHA512:
6
- metadata.gz: 18644ee3c0753253a18d4fd13da292ad4a48e5b78de3be7d2f030a400b5b5b1937bb7433fef7161ca5f29576cf33db0fece60bbc38c0aea1d8c0b08866df6d10
7
- data.tar.gz: 31ffd5af5a5472dc4e294c4b5af84750db0512ead35ecc784bad5b8bbb81f734efdf49d14d59e5e6acc643f62d47b2c016cf1720cdc6d84f6bf74f320b8dae6b
6
+ metadata.gz: 3988ac7785d2cd680e5a15a8ee039150477d3aae4cf9cb9b8436eafc0a892e5052f07fdfc9a39628667b5a092a2639e019ac821c19893e1c366756ac82a17865
7
+ data.tar.gz: 75b96e067b7dadea877d8ee84437653cdfbb088cf90a3eed87ce7618c6635bc22f56c7996a021c8f33e89f49bb607adeae24351bd46bc32f5d59aed97f63639d
@@ -21,37 +21,24 @@
21
21
  border-color: govuk-colour("white");
22
22
  }
23
23
 
24
- .gem-c-breadcrumbs--collapse-on-mobile {
24
+ .govuk-breadcrumbs--collapse-on-mobile {
25
25
  @include govuk-media-query($until: tablet) {
26
- .govuk-breadcrumbs__list {
27
- display: flex;
28
- }
29
-
30
- .govuk-breadcrumbs__list-item:not(:last-child):not(:first-child) {
31
- display: none;
32
- }
33
-
34
26
  .govuk-breadcrumbs__list-item {
35
27
  padding-top: 14px;
36
28
  padding-bottom: 14px;
37
29
  }
38
30
 
39
31
  .govuk-breadcrumbs__list-item:before {
40
- margin: 0;
41
32
  top: 18px;
42
33
  }
43
34
 
44
- .govuk-breadcrumbs__link {
45
- position: relative;
46
- }
47
-
48
35
  .govuk-breadcrumbs__link:after {
49
36
  content: "";
50
37
  position: absolute;
51
- top: -14px;
38
+ top: 0;
52
39
  right: 0;
53
40
  left: 0;
54
- bottom: -14px;
41
+ bottom: 0;
55
42
  }
56
43
  }
57
44
  }
@@ -5,7 +5,7 @@
5
5
  breadcrumb_presenter = GovukPublishingComponents::Presenters::Breadcrumbs.new(breadcrumbs)
6
6
 
7
7
  classes = "gem-c-breadcrumbs govuk-breadcrumbs"
8
- classes << " gem-c-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
8
+ classes << " govuk-breadcrumbs--collapse-on-mobile" if collapse_on_mobile
9
9
  classes << " gem-c-breadcrumbs--inverse" if inverse
10
10
  %>
11
11
 
@@ -33,6 +33,7 @@
33
33
  item[:link][:path],
34
34
  data: item[:link][:data_attributes],
35
35
  class: "#{item_classes} gem-c-document-list__item-link",
36
+ lang: item[:link][:locale].presence
36
37
  )
37
38
  else
38
39
  content_tag(
@@ -54,16 +55,24 @@
54
55
 
55
56
  <% if item[:metadata] %>
56
57
  <ul class="gem-c-document-list__item-metadata">
57
- <% item[:metadata].compact.each do |item_metadata_key, item_metadata_value| %>
58
- <li class="gem-c-document-list__attribute">
59
- <% if item_metadata_key.to_s.eql?("public_updated_at") %>
60
- <time datetime="<%= item_metadata_value.iso8601 %>">
61
- <%= l(item_metadata_value, format: '%e %B %Y') %>
62
- </time>
63
- <% else %>
64
- <%= item_metadata_value %>
58
+ <% item[:metadata].compact.each do |item_metadata_key, item_metadata_value| %>
59
+ <% if !item_metadata_key.to_s.eql?("locale") %>
60
+ <% lang = item[:metadata][:locale].present? && item[:metadata][:locale][item_metadata_key].present? ? item[:metadata][:locale][item_metadata_key] : nil %>
61
+
62
+ <%= content_tag(
63
+ :li, item_metadata_value,
64
+ class: "gem-c-document-list__attribute",
65
+ lang: lang
66
+ ) do %>
67
+ <% if item_metadata_key.to_s.eql?("public_updated_at") %>
68
+ <time datetime="<%= item_metadata_value.iso8601 %>">
69
+ <%= l(item_metadata_value, format: '%e %B %Y') %>
70
+ </time>
71
+ <% else %>
72
+ <%= item_metadata_value %>
73
+ <% end %>
65
74
  <% end %>
66
- </li>
75
+ <% end %>
67
76
  <% end %>
68
77
  </ul>
69
78
  <% end %>
@@ -262,3 +262,21 @@ examples:
262
262
  - link:
263
263
  text: 'Criteria'
264
264
  description: 'no url provided, just text'
265
+ with_locale_specified:
266
+ description: |
267
+ The component is used on translated pages that don’t have a translation for the document link text or the metadata. This means that it could display the fallback English string if the translate method can’t find an appropriate translation. This makes sure that the lang can be set to ensure that browsers understand which parts of the page are in each language.
268
+
269
+ Locales can be set separately for the document link text and individual metadata items. To set link text locale, pass a locale attribute along with the link object. To set metadata locale, pass a locale attribute containing a parallel object to your metadata (depending on which metadata have translations and which need a lang attribute to specify that they are in a different language).
270
+
271
+ The lang attribute must be set to a [valid BCP47 string](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/lang#Language_tag_syntax). A valid code can be the two or three letter language code - for example, English is en or eng, Korean is ko or kor - but if in doubt please check.
272
+ data:
273
+ items:
274
+ - link:
275
+ text: 'Tryloywder Uwch Staff Ysgrifennydd Gwladol Cymru Ionawr-Mawrth 2020'
276
+ path: '/government/publications/office-of-the-secretary-of-state-for-wales-senior-staff-transparency-january-march-2020'
277
+ locale: 'cy'
278
+ metadata:
279
+ public_updated_at: 2016-06-27 10:29:44
280
+ document_type: 'Data tryloywder'
281
+ locale:
282
+ document_type: 'cy'
@@ -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>
@@ -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:
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "21.62.0".freeze
2
+ VERSION = "21.63.0".freeze
3
3
  end
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: 21.62.0
4
+ version: 21.63.0
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: 2020-08-20 00:00:00.000000000 Z
11
+ date: 2020-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config