content_block_tools 0.6.3 → 0.6.5
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: 89f5c3789ea13016159db057ef191cbe1f977e08606c3948ad557da24cf2cb77
|
4
|
+
data.tar.gz: 6bc53e5cb65fc6260aabc7805c354984486749ed15a787ccf0d23f21e6796e73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e2e8c3ac13d8581aadbfd45a12d5426607efc7531e3057c61f3c80d5e4a6cb62396ac4db7494e8c66baf9160e4a430738c4e038f89349d65867ed57352a3925c
|
7
|
+
data.tar.gz: 1c001f490fcecb3df158d3cd17fa5ff66d184df33225fe9781a20a7c5ab34043c237dd5fc8413430bf5a4eeba766af7913662784f3d6aa898f90e7c2ce43f74d
|
data/CHANGELOG.md
CHANGED
@@ -7,6 +7,14 @@
|
|
7
7
|
useful summary for people upgrading their application, not a replication
|
8
8
|
of the commit log.
|
9
9
|
|
10
|
+
## 0.6.5
|
11
|
+
|
12
|
+
- Add opening hours to a contact block ([52](https://github.com/alphagov/govuk_content_block_tools/pull/52))
|
13
|
+
|
14
|
+
## 0.6.4
|
15
|
+
|
16
|
+
- Fix rendering of block when UK call charges are not shown ([54](https://github.com/alphagov/govuk_content_block_tools/pull/54))
|
17
|
+
|
10
18
|
## 0.6.3
|
11
19
|
|
12
20
|
- Fix rendering telephone numbers and rendering individual nested fields ([53](https://github.com/alphagov/govuk_content_block_tools/pull/53))
|
@@ -8,6 +8,7 @@ module ContentBlockTools
|
|
8
8
|
def render
|
9
9
|
content_tag(:div, class: "govuk-body") do
|
10
10
|
concat number_list
|
11
|
+
concat opening_hours_list if item[:opening_hours].any?
|
11
12
|
concat call_charges_link
|
12
13
|
end
|
13
14
|
end
|
@@ -24,12 +25,26 @@ module ContentBlockTools
|
|
24
25
|
content_tag(:li, "#{number[:label]}: #{number[:telephone_number]}", class: "govuk-!-margin-bottom-0")
|
25
26
|
end
|
26
27
|
|
28
|
+
def opening_hours_list
|
29
|
+
content_tag(:ul, class: "govuk-!-padding-0 govuk-!-margin-0 govuk-list") do
|
30
|
+
item[:opening_hours].each do |item|
|
31
|
+
concat opening_hours_list_item(item)
|
32
|
+
end
|
33
|
+
end
|
34
|
+
end
|
35
|
+
|
36
|
+
def opening_hours_list_item(item)
|
37
|
+
content_tag(:li, "#{item[:day_from]} to #{item[:day_to]}, #{item[:time_from]} to #{item[:time_to]}", class: "govuk-!-margin-bottom-0")
|
38
|
+
end
|
39
|
+
|
27
40
|
def call_charges_link
|
28
|
-
item[:show_uk_call_charges] == "true"
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
41
|
+
if item[:show_uk_call_charges] == "true"
|
42
|
+
content_tag(:p, class: "govuk-!-margin-0") do
|
43
|
+
concat content_tag(:a,
|
44
|
+
"Find out about call charges",
|
45
|
+
class: "govuk-link",
|
46
|
+
href: "https://www.gov.uk/call-charges")
|
47
|
+
end
|
33
48
|
end
|
34
49
|
end
|
35
50
|
end
|