govuk_publishing_components 20.2.2 → 20.3.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.
- checksums.yaml +4 -4
- data/app/views/govuk_publishing_components/components/_heading.html.erb +4 -1
- data/app/views/govuk_publishing_components/components/docs/heading.yml +8 -0
- data/lib/govuk_publishing_components/presenters/machine_readable/faq_page_schema.rb +6 -2
- data/lib/govuk_publishing_components/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 1f5df7e2c205738cd3d8cd009d6ca2d05c8dd239010e7069f13bcf30abbcd19e
|
|
4
|
+
data.tar.gz: 06fd2c808c46a8964422df92e7f5c7e7ed17e1e53edd7c64eb5278e420a3220f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 94dc4d5b1b0dbb6fa1623bf86dc9f261b858837e29ec495bc1d99645409248d0b89777c6450d97ee11f44186fcf2bc1e885fe90bb9ac77d7b2fd2de1db82c3e0
|
|
7
|
+
data.tar.gz: 27cf0edb974d92114e4fdfa96cbc0d41ba098794800e4fcdbf6e8f76db0811aaf3898f9aa334deda3244e35c2f6ac1ef51834301cba64a858a57db39b17d6555
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
<%
|
|
2
2
|
brand ||= false
|
|
3
|
+
lang = local_assigns[:lang].presence
|
|
4
|
+
|
|
3
5
|
brand_helper = GovukPublishingComponents::AppHelpers::BrandHelper.new(brand)
|
|
4
6
|
heading_helper = GovukPublishingComponents::Presenters::HeadingHelper.new(local_assigns)
|
|
5
7
|
shared_helper = GovukPublishingComponents::Presenters::SharedHelper.new(local_assigns)
|
|
@@ -12,5 +14,6 @@
|
|
|
12
14
|
%>
|
|
13
15
|
<%= content_tag(shared_helper.get_heading_level, text,
|
|
14
16
|
class: classes,
|
|
15
|
-
id: heading_helper.id
|
|
17
|
+
id: heading_helper.id,
|
|
18
|
+
lang: lang
|
|
16
19
|
) %>
|
|
@@ -68,3 +68,11 @@ examples:
|
|
|
68
68
|
brand: 'department-for-environment-food-rural-affairs'
|
|
69
69
|
padding: true
|
|
70
70
|
border_top: 5
|
|
71
|
+
with_lang_attribute:
|
|
72
|
+
description: |
|
|
73
|
+
The component is used on translated pages that don’t have a translation for the text strings. 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.
|
|
74
|
+
|
|
75
|
+
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.
|
|
76
|
+
data:
|
|
77
|
+
text: "Ein gweinidogion"
|
|
78
|
+
lang: "cy"
|
|
@@ -42,11 +42,15 @@ module GovukPublishingComponents
|
|
|
42
42
|
|
|
43
43
|
def part_url(part, index)
|
|
44
44
|
if index.zero?
|
|
45
|
-
|
|
45
|
+
guide_url
|
|
46
46
|
else
|
|
47
|
-
|
|
47
|
+
guide_url + "/" + part["slug"]
|
|
48
48
|
end
|
|
49
49
|
end
|
|
50
|
+
|
|
51
|
+
def guide_url
|
|
52
|
+
Plek.new.website_root + page.base_path
|
|
53
|
+
end
|
|
50
54
|
end
|
|
51
55
|
end
|
|
52
56
|
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: 20.
|
|
4
|
+
version: 20.3.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: 2019-09-
|
|
11
|
+
date: 2019-09-09 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: gds-api-adapters
|