content_block_tools 0.6.0 → 0.6.2

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: 2c9c67068e398c086a3a7def3a3e5ade924454659704267cdec35f76c8c0d004
4
+ data.tar.gz: 5ee2169390f8aa091b712c893aa3d0bf08375ce9d66f23f74e32500990c2bf00
5
5
  SHA512:
6
- metadata.gz: ed10a2a905af5a7747f8222d2ed9c815140371651ed2e0d9082d68c4b3ac333b1f6dc7d7c20cf6f2f4bfb376ab5896143d549760cb43eb0f01a8e2dc5520f4d4
7
- data.tar.gz: 1eb7eb43cfbcf21cddd296d4cc1dd7985cd6b3d3ceba02bf7bab78bcbc7ce4c2aee976eabd685b2f16b39b38632c224c03c2b8909c7d70e2178550aabbce7632
6
+ metadata.gz: 9a943d1e6f7e28ba452e3a5b690cb069c2365dc96b27c0a348905f149c97410ba65727bb7112842516bd72de05ef513df972083cbff0a6ecd0b1fcbe23628d70
7
+ data.tar.gz: eda17b6958df99a8e5e1e47c172ade147add6ce11ad5366975d2448812d25b1f85b1bcd286fdf6b00f9e452d0dc60fd8e0da973644d6b7c8833358f5a46b31b1
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,14 @@
7
7
  useful summary for people upgrading their application, not a replication
8
8
  of the commit log.
9
9
 
10
+ ## 0.6.2
11
+
12
+ - Handle UK call charges for a Contact block, remove links from telephone numbers ([51](https://github.com/alphagov/govuk_content_block_tools/pull/51))
13
+
14
+ ## 0.6.1
15
+
16
+ - Handle multiple telephone numbers for a Contact block ([48](https://github.com/alphagov/govuk_content_block_tools/pull/48)
17
+
10
18
  ## 0.6.0
11
19
 
12
20
  - Support rendering nested blocks ([45](https://github.com/alphagov/govuk_content_block_tools/pull/45))
@@ -25,10 +25,10 @@ Gem::Specification.new do |spec|
25
25
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
26
26
  spec.require_paths = %w[lib]
27
27
 
28
- spec.add_development_dependency "rake", "13.2.1"
29
- spec.add_development_dependency "rspec", "3.13.0"
28
+ spec.add_development_dependency "rake", "13.3.0"
29
+ spec.add_development_dependency "rspec", "3.13.1"
30
30
  spec.add_development_dependency "rspec-html-matchers", "0.10.0"
31
- spec.add_development_dependency "rubocop-govuk", "5.1.6"
31
+ spec.add_development_dependency "rubocop-govuk", "5.1.15"
32
32
 
33
33
  spec.add_dependency "actionview", ">= 6"
34
34
  end
@@ -4,12 +4,30 @@ 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") do
8
+ concat number_list
9
+ concat call_charges_link
10
+ end
11
+ end
12
+
13
+ def number_list
14
+ content_tag(:ul, class: "govuk-!-padding-0 govuk-!-margin-0", style: "list-style: none;") do
15
+ item[:telephone_numbers].each do |number|
16
+ concat number_list_item(number)
17
+ end
18
+ end
19
+ end
20
+
21
+ def number_list_item(number)
22
+ content_tag(:li, "#{number[:label]}: #{number[:telephone_number]}", class: "govuk-!-margin-bottom-0")
23
+ end
24
+
25
+ def call_charges_link
26
+ item[:show_uk_call_charges] == "true" && content_tag(:p, class: "govuk-!-margin-0") do
9
27
  concat content_tag(:a,
10
- item[:telephone],
28
+ "Find out about call charges",
11
29
  class: "govuk-link",
12
- href: "tel:#{CGI.escape item[:telephone]}")
30
+ href: "https://www.gov.uk/call-charges")
13
31
  end
14
32
  end
15
33
  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.2"
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.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 13.2.1
18
+ version: 13.3.0
19
19
  type: :development
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 13.2.1
25
+ version: 13.3.0
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: rspec
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 3.13.0
32
+ version: 3.13.1
33
33
  type: :development
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 3.13.0
39
+ version: 3.13.1
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rspec-html-matchers
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -57,14 +57,14 @@ dependencies:
57
57
  requirements:
58
58
  - - '='
59
59
  - !ruby/object:Gem::Version
60
- version: 5.1.6
60
+ version: 5.1.15
61
61
  type: :development
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - '='
66
66
  - !ruby/object:Gem::Version
67
- version: 5.1.6
67
+ version: 5.1.15
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: actionview
70
70
  requirement: !ruby/object:Gem::Requirement