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: 3b4f73d4250542e48814f4b1a7f9963315909983df3cd8f306316c00945c0f27
4
- data.tar.gz: b376678520df72388f10802a1652fa3819a0a3ad13d295ed681a5c7bdaf20b1d
3
+ metadata.gz: 89f5c3789ea13016159db057ef191cbe1f977e08606c3948ad557da24cf2cb77
4
+ data.tar.gz: 6bc53e5cb65fc6260aabc7805c354984486749ed15a787ccf0d23f21e6796e73
5
5
  SHA512:
6
- metadata.gz: 3ab65c991be77d1feb1f8720e9d36d193bfacae7a5e57cebad50ea894ea28a1ceac34c03df4660f0fc8d7f2ecc2195e005fd2a33133540502655e19334fc7a27
7
- data.tar.gz: aab61f2f75566b7e869ac36fc8535ad5f5a48bb8dce7304952cdf3a5f056f10e9b396c4e0cf5d7d5491d54535f6f4c131f73fc097017edb1b597adb2a6abf994
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" && content_tag(:p, class: "govuk-!-margin-0") do
29
- concat content_tag(:a,
30
- "Find out about call charges",
31
- class: "govuk-link",
32
- href: "https://www.gov.uk/call-charges")
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContentBlockTools
4
- VERSION = "0.6.3"
4
+ VERSION = "0.6.5"
5
5
  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.6.3
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev