tramway-event 1.12.2 → 1.12.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4c529a4a5e6d2219d91443ae1780dc190909dac7e620eb10f014ea706a72d862
|
4
|
+
data.tar.gz: 451ead0b0517c8dec41562ce6b727dea3f7350b49ea1e41fe2cb8f859e86bcf1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cbcbc4960148c90ac9a4aca8875e6cfc21bfa6df05890224d335a1bcebdaad71a1e6e138aab746575a3231e39d5b9e3f37c2f19e24a3a1448074184c5761c9f
|
7
|
+
data.tar.gz: 5a855610a0db0d145191519881e02bbfa73159336906869148a479f755718738979262d794961c3be59b522b0248043f27bfc8ffe619ec83052efb5bbdceee81
|
@@ -1,7 +1,7 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
class Admin::Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ExtendedApplicationForm
|
4
|
-
properties :title, :description, :field_type, :options, :position, :list_field, :presence_field
|
4
|
+
properties :title, :description, :field_type, :options, :position, :list_field, :presence_field, :select_options
|
5
5
|
association :event
|
6
6
|
|
7
7
|
def initialize(object)
|
@@ -13,7 +13,13 @@ class Admin::Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::Extende
|
|
13
13
|
options: :text,
|
14
14
|
list_field: :boolean,
|
15
15
|
presence_field: :boolean,
|
16
|
-
position: :numeric
|
16
|
+
position: :numeric,
|
17
|
+
select_options: {
|
18
|
+
type: :string,
|
19
|
+
input_options: {
|
20
|
+
hint: I18n.t('hints.tramway.event.participant_form_field.select_options')
|
21
|
+
}
|
22
|
+
}
|
17
23
|
end
|
18
24
|
end
|
19
25
|
|
@@ -21,6 +27,7 @@ class Admin::Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::Extende
|
|
21
27
|
super(params).tap do
|
22
28
|
model.options = {} if model.options == ''
|
23
29
|
model.options&.merge! list_field: (params[:list_field] == '1').to_s
|
30
|
+
model.options&.deep_merge! collection: { array: params[:select_options].split(',') || [] }
|
24
31
|
model.options&.deep_merge! validations: { presence: (params[:presence_field] == '1').to_s }
|
25
32
|
model.save
|
26
33
|
end
|
@@ -34,6 +41,10 @@ class Admin::Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::Extende
|
|
34
41
|
model.options.present? && model.options.dig('validations', 'presence') == 'true'
|
35
42
|
end
|
36
43
|
|
44
|
+
def select_options
|
45
|
+
model.options.present? && model.options.dig('collection', 'array')&.join(',')
|
46
|
+
end
|
47
|
+
|
37
48
|
def options
|
38
49
|
model.options&.to_json
|
39
50
|
end
|
data/config/locales/models.yml
CHANGED
@@ -71,6 +71,7 @@ ru:
|
|
71
71
|
title: Название (в Tramway название Поля анкеты - это ключ для выборки пользователей. Если вы измените ключ к выборке пользователей, то все пользователи, получившие данные по предыдущему ключу по этой выборке показываться не будут)
|
72
72
|
list_field: Показывать это поле в общем списке участников?
|
73
73
|
presence_field: Обязательное поле
|
74
|
+
select_options: Опции выпадающего списка
|
74
75
|
tramway/event/partaking:
|
75
76
|
part_name: Мероприятие
|
76
77
|
event_duration: Дата мероприятия
|
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.12.
|
4
|
+
version: 1.12.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-04-
|
11
|
+
date: 2020-04-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: configus
|
@@ -83,6 +83,7 @@ files:
|
|
83
83
|
- config/initializers/assets.rb
|
84
84
|
- config/initializers/tramway.rb
|
85
85
|
- config/locales/models.yml
|
86
|
+
- config/locales/ru.forms.yml
|
86
87
|
- config/locales/ru.yml
|
87
88
|
- config/locales/state_machines.yml
|
88
89
|
- config/routes.rb
|