content_block_tools 0.6.4 → 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: ef8e369276bd01a87c080d61127a7cc93f09f77a37ba0b60b6de826a6668143e
4
- data.tar.gz: f009b4fdb80e917b8539bc636b0414f453b4236297ba41bd0fee1218825da004
3
+ metadata.gz: 89f5c3789ea13016159db057ef191cbe1f977e08606c3948ad557da24cf2cb77
4
+ data.tar.gz: 6bc53e5cb65fc6260aabc7805c354984486749ed15a787ccf0d23f21e6796e73
5
5
  SHA512:
6
- metadata.gz: e931a0effa4eca7897d14d05c39a3aabdfaf2a742a3fe1b933e6a9e112fd8ea315d42ff115ebc491de358d77e281abcabb0df5a2733a970d848fb863085fb3c9
7
- data.tar.gz: a6ab3ea8acba0b9abaf68069bc6a7c5afe62ebb2ce9cea3cf85e9058308e7732bfbe283523c657a24972fa2be0e4eb76597401f99eaec735a57e299cadf6081d
6
+ metadata.gz: e2e8c3ac13d8581aadbfd45a12d5426607efc7531e3057c61f3c80d5e4a6cb62396ac4db7494e8c66baf9160e4a430738c4e038f89349d65867ed57352a3925c
7
+ data.tar.gz: 1c001f490fcecb3df158d3cd17fa5ff66d184df33225fe9781a20a7c5ab34043c237dd5fc8413430bf5a4eeba766af7913662784f3d6aa898f90e7c2ce43f74d
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.5
11
+
12
+ - Add opening hours to a contact block ([52](https://github.com/alphagov/govuk_content_block_tools/pull/52))
13
+
10
14
  ## 0.6.4
11
15
 
12
16
  - Fix rendering of block when UK call charges are not shown ([54](https://github.com/alphagov/govuk_content_block_tools/pull/54))
@@ -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,6 +25,18 @@ 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
41
  if item[:show_uk_call_charges] == "true"
29
42
  content_tag(:p, class: "govuk-!-margin-0") do
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContentBlockTools
4
- VERSION = "0.6.4"
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.4
4
+ version: 0.6.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev