govuk_publishing_components 27.6.0 → 27.7.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: 826abb0589e48d2525ea4581c2822e8c924143fd8fe1291723d8daeb9ea27aed
4
- data.tar.gz: 3609b9bc4dd4431663e8d8a9424a366c1e62259f305eb89deea5cbd730c47459
3
+ metadata.gz: 15c7bcc4d82cf3b301b7b7ba021e1bb3de52fcd8834526953c559ec6dee2c50e
4
+ data.tar.gz: 46ed67c901b6561008e808d60b42d67c5c0ff6555d47ea25eb94dfb5e89e0543
5
5
  SHA512:
6
- metadata.gz: fc3b285ebf4bb142daad075031fd004e6be838ee306d4efc21e77c887f46ce8a35a91fc7d4b8a5496941e6be16b365c778b2c2a58f3e7b32c8a2863ccb1f2e92
7
- data.tar.gz: 35d279033c32850de9356d00d89a3752203f31495b475f3810b7449ad0cb05db681d037b4f0a3b1852d635c1c9c1fb1cd5d6afb6d231341942ff742b3377e0b6
6
+ metadata.gz: f8b1714ed5784b5e37882f50855cb5ebe51c9fa334ed3214a7b3a8703efc5dfa97cabc62c5a69f5cda8ff8047ad09eb6e8869cc525d8fb782099c2b376d20ab4
7
+ data.tar.gz: ff89e8308d97f9a46ca3246e6978ea3fe24fca5852b3dac2f11f5b5822b1ac3bb7d116afe40cde48341e420347075ff52517cfd97cdb845c044a03ace9b18194
@@ -2,7 +2,7 @@
2
2
  shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
3
3
  devolved_nations_helper = GovukPublishingComponents::Presenters::DevolvedNationsHelper.new(local_assigns)
4
4
 
5
- applies_to ||= t('components.devolved_nations.applies_to')
5
+ applies_to ||= t("components.devolved_nations.applies_to")
6
6
  heading_level ||= 2
7
7
  %>
8
8
 
@@ -15,7 +15,7 @@
15
15
  <% if devolved_nations_helper.nations_with_urls.any? %>
16
16
  <%= content_tag :ul, class: "govuk-list govuk-!-margin-top-1 govuk-!-margin-bottom-0" do -%>
17
17
  <% devolved_nations_helper.nations_with_urls.each do |k, v| %>
18
- <%= content_tag(:li, link_to("Guidance for #{t("components.devolved_nations.#{k}")}", v[:alternative_url], class: "govuk-link")) %>
18
+ <%= content_tag(:li, link_to(devolved_nations_helper.alternative_content_text(k), v[:alternative_url], class: "govuk-link")) %>
19
19
  <% end %>
20
20
  <% end %>
21
21
  <% end %>
@@ -1,18 +1,18 @@
1
1
  name: Devolved Nations (experimental)
2
- description: A banner for linking to guidance for other nations.
2
+ description: A banner for linking to alternative content for other nations.
3
3
  body: |
4
- The component replaces uses of the important metadata component for guidance for other nations.
4
+ The component replaces uses of the important metadata component for alternative content for other nations.
5
5
 
6
6
  The component can display:
7
7
 
8
- * nations that the guidance relates to
8
+ * nations that the alternative content relates to
9
9
  * a list of alternative URLs where applicable
10
10
  shared_accessibility_criteria:
11
11
  - link
12
12
  accessibility_criteria: |
13
13
  The component must:
14
14
 
15
- - Provide context for link text to highlight guidance is available.
15
+ - Provide context for link text to highlight alternative content is available.
16
16
  examples:
17
17
  default:
18
18
  data:
@@ -35,18 +35,22 @@ examples:
35
35
  applicable: true
36
36
  wales:
37
37
  applicable: true
38
- applies_to_one_nation_individual_guidance_available:
38
+ applies_to_one_nation_individual_publication_available:
39
+ description: If no content type, or an invalid type, is specified then the default alternative content type is displayed as "Publication" e.g. "Publication for Northern Ireland"
39
40
  data:
40
41
  national_applicability:
41
42
  england:
42
43
  applicable: true
44
+ northern_ireland:
45
+ applicable: false
46
+ alternative_url: /
43
47
  scotland:
44
48
  applicable: false
45
49
  alternative_url: /
46
50
  wales:
47
51
  applicable: false
48
52
  alternative_url: /
49
- applies_to_one_nation_individual_guidance_available:
53
+ applies_to_three_nations_individual_publication_available:
50
54
  data:
51
55
  national_applicability:
52
56
  england:
@@ -55,12 +59,21 @@ examples:
55
59
  applicable: false
56
60
  alternative_url: /
57
61
  scotland:
58
- applicable: false
59
- alternative_url: /
62
+ applicable: true
60
63
  wales:
64
+ applicable: true
65
+ applies_to_one_nation_individual_consultation_available:
66
+ description: Specify alternative type for the content e.g. Consultation
67
+ data:
68
+ national_applicability:
69
+ england:
70
+ applicable: true
71
+ northern_ireland:
61
72
  applicable: false
62
73
  alternative_url: /
63
- applies_to_three_nations_individual_guidance_available:
74
+ type: consultation
75
+ applies_to_one_nation_individual_guidance_available:
76
+ description: Specify alternative type for the content e.g. Guidance
64
77
  data:
65
78
  national_applicability:
66
79
  england:
@@ -68,12 +81,9 @@ examples:
68
81
  northern_ireland:
69
82
  applicable: false
70
83
  alternative_url: /
71
- scotland:
72
- applicable: true
73
- wales:
74
- applicable: true
84
+ type: detailed_guide
75
85
  specific_heading level:
76
- description: Use a different heading level for the main link title. Defaults to H2 if not passed.
86
+ description: Use a different heading level for the main link title. Defaults to `H2` if not passed.
77
87
  data:
78
88
  heading_level: 3
79
89
  national_applicability:
@@ -51,6 +51,11 @@ en:
51
51
  connectors:
52
52
  last_word: " and "
53
53
  two_words: " and "
54
+ type:
55
+ consultation: Consultation for %{nation}
56
+ detailed_guide: Guidance for %{nation}
57
+ guidance: Guidance for %{nation}
58
+ publication: Publication for %{nation}
54
59
  england: England
55
60
  northern_ireland: Northern Ireland
56
61
  scotland: Scotland
@@ -1,10 +1,11 @@
1
1
  module GovukPublishingComponents
2
2
  module Presenters
3
3
  class DevolvedNationsHelper
4
- attr_reader :national_applicability
4
+ attr_reader :national_applicability, :type
5
5
 
6
6
  def initialize(local_assigns)
7
7
  @national_applicability = local_assigns[:national_applicability]
8
+ @type = local_assigns[:type] || "publication"
8
9
  end
9
10
 
10
11
  def applicable_nations_title_text
@@ -25,6 +26,16 @@ module GovukPublishingComponents
25
26
  .present?
26
27
  end
27
28
  end
29
+
30
+ def alternative_content_text(name)
31
+ nation = I18n.t("components.devolved_nations.#{name}")
32
+
33
+ if I18n.exists?("components.devolved_nations.type.#{@type}")
34
+ I18n.t("components.devolved_nations.type.#{@type}", nation: nation)
35
+ else
36
+ I18n.t("components.devolved_nations.type.publication", nation: nation)
37
+ end
38
+ end
28
39
  end
29
40
  end
30
41
  end
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = "27.6.0".freeze
2
+ VERSION = "27.7.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: 27.6.0
4
+ version: 27.7.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: 2021-10-12 00:00:00.000000000 Z
11
+ date: 2021-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: govuk_app_config