content_block_tools 0.8.0 → 0.9.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 +4 -0
- data/lib/content_block_tools/presenters/block_presenters/contact/address_presenter.rb +21 -5
- data/lib/content_block_tools/presenters/block_presenters/contact/block_level_contact_item.rb +2 -6
- data/lib/content_block_tools/presenters/block_presenters/contact/contact_form_presenter.rb +8 -6
- data/lib/content_block_tools/presenters/block_presenters/contact/email_address_presenter.rb +8 -6
- data/lib/content_block_tools/presenters/block_presenters/contact/telephone_presenter.rb +5 -3
- data/lib/content_block_tools/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 565c412328ad54e9e45ca5ce473e6876147543cf88900dafde91083042c6b0ab
|
4
|
+
data.tar.gz: 8de3aab0cbfb65213cf1dceadd420ebdd1c006d6f9e715963bb6e49383617b1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffda22c0d89798cea8b029ee90c2bc65564ab25fe7de67047251aafd53b01b1a7f127bc5c4af9deebba2e21e968767380dbde01993d9d9143394f7e0308ad5a4
|
7
|
+
data.tar.gz: '07429aa7168f233ca8935cf7c20c4e30221bdf0a1970f4376ffa30214e5bd09307509f331e97fd86e30d8babe94c7e4242c5a2cfe757dc0bfacf00a4362e351b'
|
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.9.0
|
11
|
+
|
12
|
+
- Render addresses within a `contact` div ([58](https://github.com/alphagov/govuk_content_block_tools/pull/58))
|
13
|
+
|
10
14
|
## 0.8.0
|
11
15
|
|
12
16
|
- Add wrapper classes to contact sub-blocks ([57](https://github.com/alphagov/govuk_content_block_tools/pull/57))
|
@@ -1,15 +1,31 @@
|
|
1
|
+
require_relative "./block_level_contact_item"
|
2
|
+
|
1
3
|
module ContentBlockTools
|
2
4
|
module Presenters
|
3
5
|
module BlockPresenters
|
4
6
|
module Contact
|
5
7
|
class AddressPresenter < ContentBlockTools::Presenters::BlockPresenters::BasePresenter
|
8
|
+
include ContentBlockTools::Presenters::BlockPresenters::Contact::BlockLevelContactItem
|
9
|
+
|
6
10
|
def render
|
7
|
-
|
8
|
-
|
9
|
-
|
11
|
+
wrapper do
|
12
|
+
content_tag(:p, class: "adr") do
|
13
|
+
%i[street_address locality region postal_code country].map { |field|
|
14
|
+
next if item[field].blank?
|
15
|
+
|
16
|
+
content_tag(:span, item[field], { class: class_for_field_name(field) })
|
17
|
+
}.compact_blank.join(",<br/>").html_safe
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
10
21
|
|
11
|
-
|
12
|
-
|
22
|
+
def wrapper(&block)
|
23
|
+
if @rendering_context == :field_names
|
24
|
+
content_tag(:div, class: "contact") do
|
25
|
+
yield block
|
26
|
+
end
|
27
|
+
else
|
28
|
+
yield block
|
13
29
|
end
|
14
30
|
end
|
15
31
|
|
data/lib/content_block_tools/presenters/block_presenters/contact/block_level_contact_item.rb
CHANGED
@@ -13,14 +13,10 @@ module ContentBlockTools
|
|
13
13
|
def wrapper(&block)
|
14
14
|
if @rendering_context == :field_names
|
15
15
|
content_tag(:div, class: "contact") do
|
16
|
-
content_tag(:div, class: "email-url-number") do
|
17
|
-
yield block
|
18
|
-
end
|
19
|
-
end
|
20
|
-
else
|
21
|
-
content_tag(:div, class: "email-url-number") do
|
22
16
|
yield block
|
23
17
|
end
|
18
|
+
else
|
19
|
+
yield block
|
24
20
|
end
|
25
21
|
end
|
26
22
|
end
|
@@ -9,12 +9,14 @@ module ContentBlockTools
|
|
9
9
|
|
10
10
|
def render
|
11
11
|
wrapper do
|
12
|
-
content_tag(:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
content_tag(:div, class: "email-url-number") do
|
13
|
+
content_tag(:p) do
|
14
|
+
concat content_tag(:span, item[:title])
|
15
|
+
concat content_tag(:a,
|
16
|
+
item[:url],
|
17
|
+
class: "url",
|
18
|
+
href: item[:url])
|
19
|
+
end
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
@@ -9,12 +9,14 @@ module ContentBlockTools
|
|
9
9
|
|
10
10
|
def render
|
11
11
|
wrapper do
|
12
|
-
content_tag(:
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
12
|
+
content_tag(:div, class: "email-url-number") do
|
13
|
+
content_tag(:p) do
|
14
|
+
concat content_tag(:span, item[:title])
|
15
|
+
concat content_tag(:a,
|
16
|
+
item[:email_address],
|
17
|
+
class: "email",
|
18
|
+
href: "mailto:#{item[:email_address]}")
|
19
|
+
end
|
18
20
|
end
|
19
21
|
end
|
20
22
|
end
|
@@ -9,9 +9,11 @@ module ContentBlockTools
|
|
9
9
|
|
10
10
|
def render
|
11
11
|
wrapper do
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
content_tag(:div, class: "email-url-number") do
|
13
|
+
concat number_list
|
14
|
+
concat opening_hours_list if item[:opening_hours].present?
|
15
|
+
concat call_charges_link
|
16
|
+
end
|
15
17
|
end
|
16
18
|
end
|
17
19
|
|