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: c89dc222cfb30a2a3ab8263c0203fc06fb59f5c19140b49104fa76e3a55ebf76
4
- data.tar.gz: 750d97c98bea404136dd7ab33416409cd9cb352ae587268c405c8e22236d984c
3
+ metadata.gz: 1b432a7791692f66578f8ac72f9e02548436de162c781c1359758779c72d5beb
4
+ data.tar.gz: 94df9abb5ba25e1338396802d0040659e836d1a4aca0825a86921f7045281f1b
5
5
  SHA512:
6
- metadata.gz: ed10a2a905af5a7747f8222d2ed9c815140371651ed2e0d9082d68c4b3ac333b1f6dc7d7c20cf6f2f4bfb376ab5896143d549760cb43eb0f01a8e2dc5520f4d4
7
- data.tar.gz: 1eb7eb43cfbcf21cddd296d4cc1dd7985cd6b3d3ceba02bf7bab78bcbc7ce4c2aee976eabd685b2f16b39b38632c224c03c2b8909c7d70e2178550aabbce7632
6
+ metadata.gz: 1ef1c7687153fb85bb6c92f732846f6227ed2f68f19f7c7660ac0a8c0c9d11f1943da3749d35072ac1a5f34f9402a953480597dbac7b6b11397cb3d1bbce9632
7
+ data.tar.gz: 776b3c2b907514517da5e47b206f96def040815b76edfdab10cd74b20092767a814d28f093de51358b36100ae5be7998025014e51ec773df31c90dc6288098df
data/.gitignore CHANGED
@@ -10,4 +10,10 @@
10
10
  # rspec failure tracking
11
11
  .rspec_status
12
12
  Gemfile.lock
13
+
14
+ # DS Store
13
15
  /.DS_Store
16
+ lib/.DS_Store
17
+ spec/.DS_Store
18
+ lib/content_block_tools/.DS_Store
19
+ spec/content_block_tools/.DS_Store
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(:p, class: "govuk-body govuk-!-margin-bottom-4") do
8
- concat content_tag(:span, title_content)
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
- item[:telephone],
24
+ number[:telephone_number],
11
25
  class: "govuk-link",
12
- href: "tel:#{CGI.escape item[:telephone]}")
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContentBlockTools
4
- VERSION = "0.6.0"
4
+ VERSION = "0.6.1"
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.0
4
+ version: 0.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev