content_block_tools 0.6.0 → 0.6.1
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1b432a7791692f66578f8ac72f9e02548436de162c781c1359758779c72d5beb
|
4
|
+
data.tar.gz: 94df9abb5ba25e1338396802d0040659e836d1a4aca0825a86921f7045281f1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1ef1c7687153fb85bb6c92f732846f6227ed2f68f19f7c7660ac0a8c0c9d11f1943da3749d35072ac1a5f34f9402a953480597dbac7b6b11397cb3d1bbce9632
|
7
|
+
data.tar.gz: 776b3c2b907514517da5e47b206f96def040815b76edfdab10cd74b20092767a814d28f093de51358b36100ae5be7998025014e51ec773df31c90dc6288098df
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,10 @@
|
|
7
7
|
useful summary for people upgrading their application, not a replication
|
8
8
|
of the commit log.
|
9
9
|
|
10
|
+
## 0.6.1
|
11
|
+
|
12
|
+
- Handle multiple telephone numbers for a Contact block ([48](https://github.com/alphagov/govuk_content_block_tools/pull/48)
|
13
|
+
|
10
14
|
## 0.6.0
|
11
15
|
|
12
16
|
- Support rendering nested blocks ([45](https://github.com/alphagov/govuk_content_block_tools/pull/45))
|
@@ -4,12 +4,26 @@ module ContentBlockTools
|
|
4
4
|
module Contact
|
5
5
|
class TelephonePresenter < ContentBlockTools::Presenters::BlockPresenters::BasePresenter
|
6
6
|
def render
|
7
|
-
content_tag(:
|
8
|
-
concat
|
7
|
+
content_tag(:div, class: "govuk-body govuk-!-margin-bottom-4") do
|
8
|
+
concat number_list
|
9
|
+
end
|
10
|
+
end
|
11
|
+
|
12
|
+
def number_list
|
13
|
+
content_tag(:ul, class: "govuk-!-padding-0", style: "list-style: none;") do
|
14
|
+
item[:telephone_numbers].each do |number|
|
15
|
+
concat number_list_item(number)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
20
|
+
def number_list_item(number)
|
21
|
+
content_tag(:li) do
|
22
|
+
concat content_tag(:span, "#{number[:label]}: ")
|
9
23
|
concat content_tag(:a,
|
10
|
-
|
24
|
+
number[:telephone_number],
|
11
25
|
class: "govuk-link",
|
12
|
-
href: "tel:#{CGI.escape
|
26
|
+
href: "tel:#{CGI.escape number[:telephone_number]}")
|
13
27
|
end
|
14
28
|
end
|
15
29
|
end
|
@@ -11,6 +11,7 @@ module ContentBlockTools
|
|
11
11
|
|
12
12
|
BLOCK_PRESENTERS = {
|
13
13
|
addresses: ContentBlockTools::Presenters::BlockPresenters::Contact::AddressPresenter,
|
14
|
+
telephones: ContentBlockTools::Presenters::BlockPresenters::Contact::TelephonePresenter,
|
14
15
|
}.freeze
|
15
16
|
|
16
17
|
has_embedded_objects :addresses, :email_addresses, :telephones, :contact_forms
|