content_block_tools 0.14.0 → 0.16.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/CHANGELOG.md +11 -1
- data/content_block_tools.gemspec +1 -1
- data/lib/content_block_tools/presenters/base_presenter.rb +6 -2
- data/lib/content_block_tools/presenters/block_presenters/contact/contact_link_presenter.rb +19 -7
- data/lib/content_block_tools/presenters/block_presenters/contact/email_address_presenter.rb +5 -2
- data/lib/content_block_tools/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc5c252953a643976df3b67edfeb89574770b18f19c83e8c89fe97117b9a12d3
|
4
|
+
data.tar.gz: 9621e75ef84f2e2ecfed5dc8e2452de47e157e1fa7ffc5448c133957733977a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f2e7e1129b8c885327926d605a8bfc0aa9556cf037b3c91ee4a4c36436cd7751646b31c5ecf65301c18520bb65efc45fdbb427e2d6d946f28d0cc63e090048be
|
7
|
+
data.tar.gz: c9b5aa1eae520f16eab7dd0143de7af184c7e9c07865af3054caab14cbfea1d22eaab8a85ef06bafd6363286a5b8dcbc3bdbef99a902927032ae5288d65a835d
|
data/CHANGELOG.md
CHANGED
@@ -7,9 +7,19 @@
|
|
7
7
|
useful summary for people upgrading their application, not a replication
|
8
8
|
of the commit log.
|
9
9
|
|
10
|
+
## 0.16.0
|
11
|
+
|
12
|
+
- Use label as link text for contact link ([74](https://github.com/alphagov/govuk_content_block_tools/pull/74))
|
13
|
+
- Add description to contact link ([74](https://github.com/alphagov/govuk_content_block_tools/pull/74))
|
14
|
+
- Use label as link text for contact link ([74](https://github.com/alphagov/govuk_content_block_tools/pull/74))
|
15
|
+
|
16
|
+
## 0.15.0
|
17
|
+
|
18
|
+
- Rename content block classes ([72](https://github.com/alphagov/govuk_content_block_tools/pull/72))
|
19
|
+
|
10
20
|
## 0.14.0
|
11
21
|
|
12
|
-
- Update telephone to support simple opening hours ([71](https://github.com/alphagov/govuk_content_block_tools/pull/
|
22
|
+
- Update telephone to support simple opening hours ([71](https://github.com/alphagov/govuk_content_block_tools/pull/71))
|
13
23
|
|
14
24
|
## 0.13.0
|
15
25
|
|
data/content_block_tools.gemspec
CHANGED
@@ -41,10 +41,10 @@ module ContentBlockTools
|
|
41
41
|
content_tag(
|
42
42
|
base_tag,
|
43
43
|
content,
|
44
|
-
class: %W[content-
|
44
|
+
class: %W[content-block content-block--#{document_type}],
|
45
45
|
data: {
|
46
46
|
content_block: "",
|
47
|
-
document_type:
|
47
|
+
document_type: document_type,
|
48
48
|
content_id: content_block.content_id,
|
49
49
|
embed_code: content_block.embed_code,
|
50
50
|
},
|
@@ -129,6 +129,10 @@ module ContentBlockTools
|
|
129
129
|
def embedded_objects
|
130
130
|
self.class.instance_variable_get("@embedded_objects")
|
131
131
|
end
|
132
|
+
|
133
|
+
def document_type
|
134
|
+
content_block.document_type.delete_prefix("content_block_")
|
135
|
+
end
|
132
136
|
end
|
133
137
|
end
|
134
138
|
end
|
@@ -10,16 +10,28 @@ module ContentBlockTools
|
|
10
10
|
def render
|
11
11
|
wrapper do
|
12
12
|
content_tag(:div, class: "email-url-number") do
|
13
|
-
|
14
|
-
|
15
|
-
concat content_tag(:a,
|
16
|
-
item[:url],
|
17
|
-
class: "url",
|
18
|
-
href: item[:url])
|
19
|
-
end
|
13
|
+
concat link
|
14
|
+
concat description if item[:description]
|
20
15
|
end
|
21
16
|
end
|
22
17
|
end
|
18
|
+
|
19
|
+
def link
|
20
|
+
content_tag(:p) do
|
21
|
+
content_tag(:a,
|
22
|
+
link_text,
|
23
|
+
class: "url",
|
24
|
+
href: item[:url])
|
25
|
+
end
|
26
|
+
end
|
27
|
+
|
28
|
+
def link_text
|
29
|
+
item[:label] || item[:url]
|
30
|
+
end
|
31
|
+
|
32
|
+
def description
|
33
|
+
render_govspeak(item[:description])
|
34
|
+
end
|
23
35
|
end
|
24
36
|
end
|
25
37
|
end
|
@@ -18,9 +18,8 @@ module ContentBlockTools
|
|
18
18
|
|
19
19
|
def email
|
20
20
|
content_tag(:p) do
|
21
|
-
concat content_tag(:span, item[:title])
|
22
21
|
concat content_tag(:a,
|
23
|
-
|
22
|
+
link_text,
|
24
23
|
class: "email",
|
25
24
|
href: "mailto:#{item[:email_address]}#{query_params}")
|
26
25
|
end
|
@@ -34,6 +33,10 @@ module ContentBlockTools
|
|
34
33
|
|
35
34
|
"?#{params}" if params.present?
|
36
35
|
end
|
36
|
+
|
37
|
+
def link_text
|
38
|
+
item[:label] || item[:email_address]
|
39
|
+
end
|
37
40
|
end
|
38
41
|
end
|
39
42
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: content_block_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.16.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- GOV.UK Dev
|
@@ -85,14 +85,14 @@ dependencies:
|
|
85
85
|
requirements:
|
86
86
|
- - '='
|
87
87
|
- !ruby/object:Gem::Version
|
88
|
-
version: 10.6.
|
88
|
+
version: 10.6.1
|
89
89
|
type: :runtime
|
90
90
|
prerelease: false
|
91
91
|
version_requirements: !ruby/object:Gem::Requirement
|
92
92
|
requirements:
|
93
93
|
- - '='
|
94
94
|
- !ruby/object:Gem::Version
|
95
|
-
version: 10.6.
|
95
|
+
version: 10.6.1
|
96
96
|
email:
|
97
97
|
- govuk-dev@digital.cabinet-office.gov.uk
|
98
98
|
executables: []
|