content_block_tools 0.6.1 → 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: 1b432a7791692f66578f8ac72f9e02548436de162c781c1359758779c72d5beb
4
- data.tar.gz: 94df9abb5ba25e1338396802d0040659e836d1a4aca0825a86921f7045281f1b
3
+ metadata.gz: 2c9c67068e398c086a3a7def3a3e5ade924454659704267cdec35f76c8c0d004
4
+ data.tar.gz: 5ee2169390f8aa091b712c893aa3d0bf08375ce9d66f23f74e32500990c2bf00
5
5
  SHA512:
6
- metadata.gz: 1ef1c7687153fb85bb6c92f732846f6227ed2f68f19f7c7660ac0a8c0c9d11f1943da3749d35072ac1a5f34f9402a953480597dbac7b6b11397cb3d1bbce9632
7
- data.tar.gz: 776b3c2b907514517da5e47b206f96def040815b76edfdab10cd74b20092767a814d28f093de51358b36100ae5be7998025014e51ec773df31c90dc6288098df
6
+ metadata.gz: 9a943d1e6f7e28ba452e3a5b690cb069c2365dc96b27c0a348905f149c97410ba65727bb7112842516bd72de05ef513df972083cbff0a6ecd0b1fcbe23628d70
7
+ data.tar.gz: eda17b6958df99a8e5e1e47c172ade147add6ce11ad5366975d2448812d25b1f85b1bcd286fdf6b00f9e452d0dc60fd8e0da973644d6b7c8833358f5a46b31b1
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.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
+
10
14
  ## 0.6.1
11
15
 
12
16
  - Handle multiple telephone numbers for a Contact block ([48](https://github.com/alphagov/govuk_content_block_tools/pull/48)
@@ -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,13 +4,14 @@ module ContentBlockTools
4
4
  module Contact
5
5
  class TelephonePresenter < ContentBlockTools::Presenters::BlockPresenters::BasePresenter
6
6
  def render
7
- content_tag(:div, class: "govuk-body govuk-!-margin-bottom-4") do
7
+ content_tag(:div, class: "govuk-body") do
8
8
  concat number_list
9
+ concat call_charges_link
9
10
  end
10
11
  end
11
12
 
12
13
  def number_list
13
- content_tag(:ul, class: "govuk-!-padding-0", style: "list-style: none;") do
14
+ content_tag(:ul, class: "govuk-!-padding-0 govuk-!-margin-0", style: "list-style: none;") do
14
15
  item[:telephone_numbers].each do |number|
15
16
  concat number_list_item(number)
16
17
  end
@@ -18,12 +19,15 @@ module ContentBlockTools
18
19
  end
19
20
 
20
21
  def number_list_item(number)
21
- content_tag(:li) do
22
- concat content_tag(:span, "#{number[:label]}: ")
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
23
27
  concat content_tag(:a,
24
- number[:telephone_number],
28
+ "Find out about call charges",
25
29
  class: "govuk-link",
26
- href: "tel:#{CGI.escape number[:telephone_number]}")
30
+ href: "https://www.gov.uk/call-charges")
27
31
  end
28
32
  end
29
33
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ContentBlockTools
4
- VERSION = "0.6.1"
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.1
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