tramway-event 1.8.9 → 1.8.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: cacae39a07be0ae7ce9602eabba11eacc6b6c94302416c98cd03f689227ea65c
4
- data.tar.gz: 8329705911bbcfdf49f6689700268902cf73b91d9067c5fb02f426365d3878ea
3
+ metadata.gz: 9d0adbec3f4557fb5425681c1cffb056109f570b52fe509cb00ac34e145609c6
4
+ data.tar.gz: 39496020cc747f886ad3523622a5c2b88cd6b2e389c973663b5ff072b2e15ec4
5
5
  SHA512:
6
- metadata.gz: ccc47f63b98af3130ac1cdd3679d5db793a2a6e2d05db195dc73df2a749f86e4c481a6a7b1d0f02381a8ba301f274095ee5e5701023764a976d4b38f0d36fef8
7
- data.tar.gz: 1b17ee09e14d861c085f784fcb08a7e2ed9fa41a20dd9fa4cf58be9653eea1ef60dcdf72566d5dcea32863bd7866160b9822e32b89e375dfbf4e02e181b983a5
6
+ metadata.gz: b8d22de331a0e8d4675b6cd5c067cef25c9c0aba6dd167f7d9b58e68b5ff6922402b18bd111e3f3f6ed796fceb95c86582b6a6106cb8e19306b3d6229a81f3e2
7
+ data.tar.gz: 77034da5f129f7e0f4cb86d4db9a674d74b76a17c68346683f6d276d918ed90ce5c60e7537e4a221e560faa0e836c11fe6c82815d6cb7992fd78da737f952dc2
@@ -1,4 +1,5 @@
1
1
  class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorator
2
+ include HTMLTagsHelpers
2
3
  class << self
3
4
  def collections
4
5
  [ :requested, :waiting, :prev_approved, :without_answer, :approved, :rejected, :reserved, :all ]
@@ -38,7 +39,12 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
38
39
  field.title
39
40
  end)
40
41
  concat(content_tag(:td) do
41
- object.values&.dig( field.title )
42
+ value = object.values&.dig( field.title )
43
+ if russian_phone_number?(value)
44
+ tel_tag value
45
+ else
46
+ value
47
+ end
42
48
  end)
43
49
  end)
44
50
  end
@@ -54,7 +60,11 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
54
60
  key
55
61
  end)
56
62
  concat(content_tag(:td) do
57
- value
63
+ concat(if russian_phone_number?(value)
64
+ tel_tag value
65
+ else
66
+ value
67
+ end)
58
68
  end)
59
69
  end)
60
70
  end
@@ -73,4 +83,10 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
73
83
  :warning
74
84
  end
75
85
  end
86
+
87
+ private
88
+
89
+ def russian_phone_number?(value)
90
+ value.to_s.match(/((8|\+7)-?)?\(?\d{3}\)?-?\d{1}-?\d{1}-?\d{1}-?\d{1}-?\d{1}-?\d{1}-?\d{1}/)
91
+ end
76
92
  end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Event
3
- VERSION = '1.8.9'
3
+ VERSION = '1.8.10'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.9
4
+ version: 1.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-25 00:00:00.000000000 Z
11
+ date: 2018-12-19 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for events
14
14
  email: