tramway-event 1.9.22 → 1.9.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/decorators/tramway/event/event_decorator.rb +1 -0
- data/app/decorators/tramway/event/participant_decorator.rb +26 -0
- data/app/decorators/tramway/event/participant_form_field_decorator.rb +24 -0
- data/app/models/tramway/event/event.rb +1 -3
- data/app/views/tramway/event/participants/_form.html.haml +1 -1
- data/config/locales/models.yml +29 -0
- data/lib/tramway/event/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 259b5618ba826807b3824dcd0abd0055e48d03a94c44bb24183705abc7584303
|
4
|
+
data.tar.gz: 7706babd97fc694ed8221a4e4017685c8dcc930fba1a513642ae6c259532b2d3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1c0a9523dfa7b37590dec9be5d3c09ee9ad24ca5c9d920866e47c8ec35209760c3da5d119bce254f557c9d6bd2bee2f847ae5c4a1e960765850baf3db64c687d
|
7
|
+
data.tar.gz: 167fdbb658824a4891d7abdd64a25ff3f9aa2b42d5a4ad4b54edd6276a6c704eadbcb57012efad5e83cb4f5b93bdd1bfd9b040f5b14331882e2365a88d8acde5
|
@@ -68,6 +68,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
|
|
68
68
|
|
69
69
|
def request_collecting_duration
|
70
70
|
return if object.request_collecting_begin_date.nil? || object.request_collecting_end_date.nil?
|
71
|
+
|
71
72
|
duration begin_date: object.request_collecting_begin_date, end_date: object.request_collecting_end_date
|
72
73
|
end
|
73
74
|
|
@@ -11,6 +11,10 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
|
|
11
11
|
[:list_fields]
|
12
12
|
end
|
13
13
|
delegate :human_participation_state_event_name, to: :model_class
|
14
|
+
|
15
|
+
def show_attributes
|
16
|
+
%i[id event values state created_at updated_at participation_state comment]
|
17
|
+
end
|
14
18
|
end
|
15
19
|
|
16
20
|
decorate_association :event
|
@@ -24,6 +28,10 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
|
|
24
28
|
end
|
25
29
|
end
|
26
30
|
|
31
|
+
def event
|
32
|
+
object.event.title
|
33
|
+
end
|
34
|
+
|
27
35
|
def list_fields
|
28
36
|
content_tag :table, class: :table do
|
29
37
|
concat(content_tag(:tr) do
|
@@ -86,6 +94,24 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
|
|
86
94
|
end
|
87
95
|
end
|
88
96
|
|
97
|
+
def state
|
98
|
+
state_machine_view object, :state
|
99
|
+
end
|
100
|
+
|
101
|
+
def created_at
|
102
|
+
date_view object.created_at
|
103
|
+
end
|
104
|
+
|
105
|
+
def updated_at
|
106
|
+
date_view object.updated_at
|
107
|
+
end
|
108
|
+
|
109
|
+
def participation_state
|
110
|
+
state_machine_view object, :participation_state
|
111
|
+
end
|
112
|
+
|
113
|
+
delegate :comment, to: :object
|
114
|
+
|
89
115
|
def participation_state_button_color(event)
|
90
116
|
case event
|
91
117
|
when :previous_approve, :approve
|
@@ -9,8 +9,16 @@ class Tramway::Event::ParticipantFormFieldDecorator < ::Tramway::Core::Applicati
|
|
9
9
|
def list_attributes
|
10
10
|
[:event_title]
|
11
11
|
end
|
12
|
+
|
13
|
+
def show_attributes
|
14
|
+
%i[id title description field_type event_title state created_at updated_at options position]
|
15
|
+
end
|
12
16
|
end
|
13
17
|
|
18
|
+
delegate :description, to: :object
|
19
|
+
delegate :options, to: :object
|
20
|
+
delegate :position, to: :object
|
21
|
+
|
14
22
|
def title
|
15
23
|
"#{object.title} #{object.event.title}"
|
16
24
|
end
|
@@ -18,4 +26,20 @@ class Tramway::Event::ParticipantFormFieldDecorator < ::Tramway::Core::Applicati
|
|
18
26
|
def event_title
|
19
27
|
object.event.title
|
20
28
|
end
|
29
|
+
|
30
|
+
def field_type
|
31
|
+
enumerize_view object.field_type
|
32
|
+
end
|
33
|
+
|
34
|
+
def state
|
35
|
+
state_machine_view object, :state
|
36
|
+
end
|
37
|
+
|
38
|
+
def created_at
|
39
|
+
date_view object.created_at
|
40
|
+
end
|
41
|
+
|
42
|
+
def updated_at
|
43
|
+
date_view object.updated_at
|
44
|
+
end
|
21
45
|
end
|
@@ -24,7 +24,5 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
|
|
24
24
|
return :are_being_right_now if request_collecting_begin_date&.past? && request_collecting_end_date&.future?
|
25
25
|
end
|
26
26
|
|
27
|
-
if defined? ::Tramway::Partner
|
28
|
-
include ::Tramway::Partner::Scopes
|
29
|
-
end
|
27
|
+
include ::Tramway::Partner::Scopes if defined? ::Tramway::Partner
|
30
28
|
end
|
@@ -8,4 +8,4 @@
|
|
8
8
|
= f.input :event_id, as: :hidden, input_html: { value: event.id, class: class_name, id: "#{class_name}_event_id", name: "#{class_name}[event_id]" }
|
9
9
|
- event.participant_form_fields.inputs_list.each do |field|
|
10
10
|
= render 'tramway/core/shared/input_extended', field: field, class_name: class_name, f: f
|
11
|
-
= f.button :submit, t('.submit_form')
|
11
|
+
= f.button :submit, t('.submit_form')
|
data/config/locales/models.yml
CHANGED
@@ -1,4 +1,14 @@
|
|
1
1
|
ru:
|
2
|
+
simple_form:
|
3
|
+
tramway/event/participant_form_field:
|
4
|
+
input:
|
5
|
+
field_type:
|
6
|
+
Yes: Да
|
7
|
+
no: Нет
|
8
|
+
|
9
|
+
default:
|
10
|
+
collections:
|
11
|
+
all: Все
|
2
12
|
activerecord:
|
3
13
|
models:
|
4
14
|
tramway/event/event: Мероприятие
|
@@ -27,12 +37,17 @@ ru:
|
|
27
37
|
participants_list: Список участников
|
28
38
|
does_not_have_end_date: мероприятие не имеет даты окончания
|
29
39
|
tramway/event/participant:
|
40
|
+
name: Имя
|
41
|
+
list_fields: Данные
|
30
42
|
comment: Примечание
|
31
43
|
event: Мероприятие
|
32
44
|
full_name: Полное имя
|
33
45
|
email: Email
|
34
46
|
phone: Телефон
|
35
47
|
organization: Организация
|
48
|
+
participation_state: Статус участника
|
49
|
+
event: Мероприятие
|
50
|
+
values: Данные
|
36
51
|
tramway/event/section:
|
37
52
|
title: Название
|
38
53
|
description: Описание
|
@@ -41,6 +56,13 @@ ru:
|
|
41
56
|
icon: Иконка
|
42
57
|
position: Позиция на странице мероприятия
|
43
58
|
tramway/event/participant_form_field:
|
59
|
+
event_title: Мероприятие
|
60
|
+
name: Название
|
61
|
+
event: Мероприятие
|
62
|
+
description: Описание
|
63
|
+
field_type: Тип поля
|
64
|
+
position: Позиция в анкете
|
65
|
+
options: Параметры
|
44
66
|
title: Название (в Tramway название Поля анкеты - это ключ для выборки пользователей. Если вы измените ключ к выборке пользователей, то все пользователи, получившие данные по предыдущему ключу по этой выборке показываться не будут)
|
45
67
|
tramway/event/partaking:
|
46
68
|
part_name: Мероприятие
|
@@ -82,3 +104,10 @@ ru:
|
|
82
104
|
status:
|
83
105
|
main: На главной странице
|
84
106
|
common: Не на главной странице
|
107
|
+
tramway/event/participant_form_field:
|
108
|
+
field_type:
|
109
|
+
text: Многострочный текст
|
110
|
+
string: Текст
|
111
|
+
numeric: Число
|
112
|
+
date_picker: Дата
|
113
|
+
select: Выпадающий список (да/нет)
|
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.9.
|
4
|
+
version: 1.9.23
|
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-01-
|
11
|
+
date: 2020-01-21 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails engine for events
|
14
14
|
email:
|