cck_forms 3.4.1 → 3.4.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc4907e7cfc886d816dec72188a09782a95a913c
|
4
|
+
data.tar.gz: ed15ab4358fc8874951b68f1ede216bcdd6e49f7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 866ef1e469bcc36f90de410af71954ccb004878eacdd557aaf6a54fe3f90f4b13a9d19cbcf792ee563dfafb9040bb8a765336f26c4ea07fd220fcf77a34e5e52
|
7
|
+
data.tar.gz: 449fc5a166723a8dafe444f9528db39b18492659317c16c645d163239f87be09e24f97c1d933c84c58a6982ef1a55caa790e6f0127f45aba62c75cbdd343ed74
|
@@ -174,14 +174,21 @@ class CckForms::ParameterTypeClass::Map
|
|
174
174
|
inputs << value_builder.hidden_field(:type, value: value['type'])
|
175
175
|
end
|
176
176
|
|
177
|
-
allowed_maps
|
178
|
-
map_names
|
177
|
+
allowed_maps = @@map_providers
|
178
|
+
map_names = {'google' => 'Google', 'yandex' => 'Yandex'}
|
179
179
|
selected_map_type = value['type'].in?(allowed_maps) ? value['type'] : allowed_maps.first
|
180
|
+
group_class = options[:group_class].presence || 'btn-group'
|
181
|
+
switcher_classes = {
|
182
|
+
'yandex' => options[:yandex_button_class],
|
183
|
+
'google' => options[:google_button_class]
|
184
|
+
}
|
180
185
|
|
181
186
|
switchers = []
|
182
|
-
switchers << %Q|<div class="
|
187
|
+
switchers << %Q|<div class="#{group_class} cck-map-switchers #{'hide' if allowed_maps.count < 2}" style="margin-top: 5px;">|
|
183
188
|
allowed_maps.map do |map|
|
184
|
-
|
189
|
+
button_class = switcher_classes[map].presence || 'btn btn-default'
|
190
|
+
button_class << ' active' if selected_map_type == map
|
191
|
+
switchers << %Q|<a class="#{button_class}" href="#" data-map-type="#{map}">#{map_names[map]}</a>|
|
185
192
|
end
|
186
193
|
switchers << '</div>'
|
187
194
|
|
@@ -79,6 +79,7 @@ class CckForms::ParameterTypeClass::Phones
|
|
79
79
|
code_class = options[:code_class].presence || 'input-mini form-control'
|
80
80
|
number_class = options[:number_class].presence || 'input-small form-control'
|
81
81
|
group_class = options[:group_class].presence || 'form-inline'
|
82
|
+
delimiter = options[:delimiter].presence || '—'
|
82
83
|
|
83
84
|
phone_form = []
|
84
85
|
|
@@ -88,7 +89,9 @@ class CckForms::ParameterTypeClass::Phones
|
|
88
89
|
phone_form << phone_builder.text_field(:number, class: number_class, value: phone['number'])
|
89
90
|
end
|
90
91
|
|
91
|
-
|
92
|
+
full_phone_form = [phone_form[0], delimiter, phone_form[1], delimiter, phone_form[2]].join
|
93
|
+
|
94
|
+
sprintf '<p class="%s">%s</p>', group_class, full_phone_form
|
92
95
|
end
|
93
96
|
|
94
97
|
# 1 empty phone Hash: {prefix: '+7', code: '', number: ''}
|
data/lib/cck_forms/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cck_forms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.4.
|
4
|
+
version: 3.4.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ilya Konanykhin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|