content_block_tools 0.15.0 → 0.17.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 +10 -0
- data/content_block_tools.gemspec +1 -1
- data/lib/content_block_tools/presenters/block_presenters/contact/address_presenter.rb +2 -1
- 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: b4c641c9036c389a69525715b7e71149166f7511ab1de92f4c15ad95b16d62dd
|
4
|
+
data.tar.gz: a607de42bbe8f3b0fe1906d46743e1f73486ea792b1a2cb1374084afa398f4f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d711299258a6a6156ba85240bc67143989ace9485999bc41f6e45510294a61418622bfa329eaf6f8b2f693b2a816008cdffaf53e899660e8ba63d8fc8f043bee
|
7
|
+
data.tar.gz: a83c41c21a95b2f35c67a2be4ceead0ff6c1fe5d11e3993fa902456063667c519b9750f45175a0306627980581a9d55bda1b24a8b27a0b6bb8b04bb80bd0234c
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,16 @@
|
|
7
7
|
useful summary for people upgrading their application, not a replication
|
8
8
|
of the commit log.
|
9
9
|
|
10
|
+
## 0.17.0
|
11
|
+
|
12
|
+
- Use recipient field in address ([75](https://github.com/alphagov/govuk_content_block_tools/pull/75))
|
13
|
+
|
14
|
+
## 0.16.0
|
15
|
+
|
16
|
+
- Use label as link text for contact link ([74](https://github.com/alphagov/govuk_content_block_tools/pull/74))
|
17
|
+
- Add description to contact link ([74](https://github.com/alphagov/govuk_content_block_tools/pull/74))
|
18
|
+
- Use label as link text for contact link ([74](https://github.com/alphagov/govuk_content_block_tools/pull/74))
|
19
|
+
|
10
20
|
## 0.15.0
|
11
21
|
|
12
22
|
- Rename content block classes ([72](https://github.com/alphagov/govuk_content_block_tools/pull/72))
|
data/content_block_tools.gemspec
CHANGED
@@ -12,7 +12,7 @@ module ContentBlockTools
|
|
12
12
|
output = []
|
13
13
|
|
14
14
|
output << content_tag(:p, class: "adr") do
|
15
|
-
%i[
|
15
|
+
%i[recipient street_address town_or_city state_or_county postal_code country].map { |field|
|
16
16
|
next if item[field].blank?
|
17
17
|
|
18
18
|
content_tag(:span, item[field], { class: class_for_field_name(field) })
|
@@ -27,6 +27,7 @@ module ContentBlockTools
|
|
27
27
|
|
28
28
|
def class_for_field_name(field_name)
|
29
29
|
{
|
30
|
+
recipient: "organization-name",
|
30
31
|
street_address: "street-address",
|
31
32
|
town_or_city: "locality",
|
32
33
|
state_or_county: "region",
|
@@ -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.17.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: []
|