tramway-event 1.9.16 → 1.9.19
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 +4 -4
- data/app/controllers/tramway/event/participants_controller.rb +1 -1
- data/app/decorators/tramway/event/participant_xlsx_decorator.rb +33 -0
- data/app/decorators/tramway/event/place_decorator.rb +3 -0
- data/app/forms/tramway/event/participant_extended_form_creator.rb +1 -1
- data/app/forms/tramway/event/place_form.rb +13 -0
- data/app/models/tramway/event/event.rb +1 -0
- data/app/models/tramway/event/participant.rb +1 -1
- data/app/models/tramway/event/place.rb +3 -0
- data/app/views/tramway/event/events/_show_page.html.haml +0 -1
- data/config/initializers/tramway.rb +1 -0
- data/config/locales/models.yml +9 -1
- data/config/locales/state_machines.yml +2 -2
- data/lib/tramway/event/generators/install_generator.rb +4 -1
- data/lib/tramway/event/generators/templates/create_tramway_event_events_places.rb +10 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_places.rb +14 -0
- data/lib/tramway/event/version.rb +1 -1
- metadata +9 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 04612e4d92c227210e6f6ef30048df7ab0589c44acec5b622a4fd2443e3781d2
|
|
4
|
+
data.tar.gz: c8c976aa58509702a2c1981362043783b20d6601388d5bd959eb852cb20cc679
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8ff4bb5e94787ecc29145c5b52c91607092d0f1b5e8d695685fcbea4f4d78a6a06bd854ffc92be29ee4c242973f87a01ed209aff0b05a2651396cdd28bc77fb1
|
|
7
|
+
data.tar.gz: 95abf3e86d185b6a0a53c641ed8ac56082f94e234b9e815764dd351f27e28feb55faff67618510882ddcec4d5ae7871bcc69b316fe1d36788330505cc8c56fae
|
|
@@ -5,7 +5,7 @@ class Tramway::Event::ParticipantsController < Tramway::Event::ApplicationContro
|
|
|
5
5
|
if @participant_form.submit params[:tramway_event_participant].except :event_id
|
|
6
6
|
redirect_to event_path event, flash: :success
|
|
7
7
|
else
|
|
8
|
-
redirect_to event_path event, flash: :error
|
|
8
|
+
redirect_to event_path event, flash: :error, errors: @participant_form.errors.messages
|
|
9
9
|
end
|
|
10
10
|
end
|
|
11
11
|
end
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
class Tramway::Event::ParticipantXlsxDecorator < Tramway::Export::Xlsx::ApplicationDecorator
|
|
2
|
+
class << self
|
|
3
|
+
def columns
|
|
4
|
+
[ :full_name, :email, :phone, :organization, :event ].map do |attribute|
|
|
5
|
+
{ Tramway::Event::Participant.human_attribute_name(attribute).to_sym => attribute }
|
|
6
|
+
end
|
|
7
|
+
end
|
|
8
|
+
|
|
9
|
+
def filename
|
|
10
|
+
'participants.xlsx'
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
|
|
14
|
+
def full_name
|
|
15
|
+
"#{object.values['Фамилия'] || object.values['Фамилия ']} #{object.values['Имя'] || object.values['Имя ']}"
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def email
|
|
19
|
+
object.values['Email']
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def phone
|
|
23
|
+
object.values['Телефон']
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def organization
|
|
27
|
+
object.values['Место работы/ Учебное заведение']
|
|
28
|
+
end
|
|
29
|
+
|
|
30
|
+
def event
|
|
31
|
+
object.event.title
|
|
32
|
+
end
|
|
33
|
+
end
|
|
@@ -2,7 +2,7 @@ class Tramway::Event::ParticipantExtendedFormCreator < Tramway::Core::FormCreato
|
|
|
2
2
|
def self.create_form_class(uuid, event, **simple_properties)
|
|
3
3
|
class_name = "ParticipantExtendedForm#{uuid.gsub('-', '')}"
|
|
4
4
|
properties = event.participant_form_fields.inputs_list.reduce({}) do |hash, field|
|
|
5
|
-
hash.merge! field.title.to_sym => field
|
|
5
|
+
hash.merge! field.title.to_sym => { object: field, validates: field.options['validations'] }
|
|
6
6
|
end
|
|
7
7
|
if simple_properties.keys.any?
|
|
8
8
|
::Tramway::Core::ExtendableForm.new(class_name, simple_properties: simple_properties, **properties)
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
class Tramway::Event::PlaceForm < Tramway::Core::ApplicationForm
|
|
2
|
+
properties :title, :description, :coordinates, :photo, :city
|
|
3
|
+
|
|
4
|
+
def initialize(object)
|
|
5
|
+
super(object).tap do
|
|
6
|
+
form_properties title: :string,
|
|
7
|
+
description: :ckeditor,
|
|
8
|
+
coordinates: :string,
|
|
9
|
+
photo: :file,
|
|
10
|
+
city: :string
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -7,6 +7,7 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
|
|
|
7
7
|
has_many :partakings, as: :part, class_name: 'Tramway::Event::Partaking'
|
|
8
8
|
has_many :partnerships, class_name: 'Tramway::Partner::Partnership', as: :partner
|
|
9
9
|
has_many :organizations, as: :partners, through: :partnerships, class_name: 'Tramway::Partner::Organization'
|
|
10
|
+
has_and_belongs_to_many :places
|
|
10
11
|
|
|
11
12
|
enumerize :status, default: :common, in: [ :common, :main ]
|
|
12
13
|
|
|
@@ -4,7 +4,6 @@
|
|
|
4
4
|
%button.close{"aria-label" => "Close", "data-dismiss" => "alert", type: "button"}
|
|
5
5
|
%span{"aria-hidden" => "true"} ×
|
|
6
6
|
%h4.alert-heading Заявка успешно отправлена!
|
|
7
|
-
%p Ваша заявка на мероприятие подтверждена!
|
|
8
7
|
%hr/
|
|
9
8
|
%p.mb-0
|
|
10
9
|
По всем вопросам обращайтесь по телефону
|
data/config/locales/models.yml
CHANGED
|
@@ -7,6 +7,7 @@ ru:
|
|
|
7
7
|
tramway/event/section: Секция
|
|
8
8
|
tramway/event/person: Член команды
|
|
9
9
|
tramway/event/partaking: Должность
|
|
10
|
+
tramway/event/place: Место
|
|
10
11
|
attributes:
|
|
11
12
|
tramway/event/event:
|
|
12
13
|
title: Название
|
|
@@ -27,6 +28,10 @@ ru:
|
|
|
27
28
|
tramway/event/participant:
|
|
28
29
|
comment: Примечание
|
|
29
30
|
event: Мероприятие
|
|
31
|
+
full_name: Полное имя
|
|
32
|
+
email: Email
|
|
33
|
+
phone: Телефон
|
|
34
|
+
organization: Организация
|
|
30
35
|
tramway/event/section:
|
|
31
36
|
title: Название
|
|
32
37
|
description: Описание
|
|
@@ -59,13 +64,16 @@ ru:
|
|
|
59
64
|
tramway/event/partaking:
|
|
60
65
|
genitive: должность
|
|
61
66
|
plural: должности
|
|
67
|
+
tramway/event/place:
|
|
68
|
+
genitive: место
|
|
69
|
+
plural: места
|
|
62
70
|
collections:
|
|
63
71
|
tramway/event/participant:
|
|
64
72
|
requested: Необработанные
|
|
65
73
|
prev_approved: Предварительно подтверждены
|
|
66
74
|
waiting: Ожидаем ответа
|
|
67
75
|
rejected: Отклонены
|
|
68
|
-
approved:
|
|
76
|
+
approved: Пришли
|
|
69
77
|
without_answer: Не ответили
|
|
70
78
|
reserved: В резерве
|
|
71
79
|
enumerize:
|
|
@@ -12,14 +12,14 @@ ru:
|
|
|
12
12
|
prev_approved: Получено предварительное подтверждение
|
|
13
13
|
waiting: Ожидание решения
|
|
14
14
|
rejected: Заявка отклонена
|
|
15
|
-
approved:
|
|
15
|
+
approved: Прибывшие
|
|
16
16
|
without_answer: Без ответа
|
|
17
17
|
reserved: В резерве
|
|
18
18
|
events:
|
|
19
19
|
previous_approve: Предварительно подтвердить
|
|
20
20
|
wait_for_decision: Ожидать ответа
|
|
21
21
|
reject: Отклонить
|
|
22
|
-
approve:
|
|
22
|
+
approve: Прибыл(а)
|
|
23
23
|
not_got_answer: Связаться не удалось
|
|
24
24
|
reserve: Отправить в резерв
|
|
25
25
|
return_to_requested: Вернуть в необработанные
|
|
@@ -41,7 +41,10 @@ module Tramway::Event::Generators
|
|
|
41
41
|
:rebuild_association_between_participant_and_partakings_to_polymorphic,
|
|
42
42
|
|
|
43
43
|
:add_request_period_to_tramway_event_events,
|
|
44
|
-
:add_description_to_tramway_event_people
|
|
44
|
+
:add_description_to_tramway_event_people,
|
|
45
|
+
|
|
46
|
+
:create_tramway_event_places,
|
|
47
|
+
:create_tramway_event_events_places
|
|
45
48
|
]
|
|
46
49
|
migrations.each do |migration|
|
|
47
50
|
migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
class CreateTramwayEventPlaces < ActiveRecord::Migration[5.1]
|
|
2
|
+
def change
|
|
3
|
+
create_table :tramway_event_places do |t|
|
|
4
|
+
t.text :title
|
|
5
|
+
t.text :description
|
|
6
|
+
t.point :coordinates
|
|
7
|
+
t.text :photo
|
|
8
|
+
t.text :city
|
|
9
|
+
t.text :state, default: :active
|
|
10
|
+
|
|
11
|
+
t.timestamps
|
|
12
|
+
end
|
|
13
|
+
end
|
|
14
|
+
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.9.
|
|
4
|
+
version: 1.9.19
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Pavel Kalashnikov
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2019-
|
|
11
|
+
date: 2019-10-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Rails engine for events
|
|
14
14
|
email:
|
|
@@ -34,7 +34,9 @@ files:
|
|
|
34
34
|
- app/decorators/tramway/event/partaking_feature_decorator.rb
|
|
35
35
|
- app/decorators/tramway/event/participant_decorator.rb
|
|
36
36
|
- app/decorators/tramway/event/participant_form_field_decorator.rb
|
|
37
|
+
- app/decorators/tramway/event/participant_xlsx_decorator.rb
|
|
37
38
|
- app/decorators/tramway/event/person_decorator.rb
|
|
39
|
+
- app/decorators/tramway/event/place_decorator.rb
|
|
38
40
|
- app/decorators/tramway/event/section_decorator.rb
|
|
39
41
|
- app/decorators/tramway/event/section_feature_decorator.rb
|
|
40
42
|
- app/forms/tramway/event/event_form.rb
|
|
@@ -43,6 +45,7 @@ files:
|
|
|
43
45
|
- app/forms/tramway/event/participant_form.rb
|
|
44
46
|
- app/forms/tramway/event/participant_form_field_form.rb
|
|
45
47
|
- app/forms/tramway/event/person_form.rb
|
|
48
|
+
- app/forms/tramway/event/place_form.rb
|
|
46
49
|
- app/forms/tramway/event/section_form.rb
|
|
47
50
|
- app/helpers/tramway/event/application_helper.rb
|
|
48
51
|
- app/jobs/tramway/event/application_job.rb
|
|
@@ -53,6 +56,7 @@ files:
|
|
|
53
56
|
- app/models/tramway/event/participant.rb
|
|
54
57
|
- app/models/tramway/event/participant_form_field.rb
|
|
55
58
|
- app/models/tramway/event/person.rb
|
|
59
|
+
- app/models/tramway/event/place.rb
|
|
56
60
|
- app/models/tramway/event/section.rb
|
|
57
61
|
- app/views/tramway/event/events/_show_page.html.haml
|
|
58
62
|
- app/views/tramway/event/events/show.html.haml
|
|
@@ -80,10 +84,12 @@ files:
|
|
|
80
84
|
- lib/tramway/event/generators/templates/add_state_to_tramway_event_partakings.rb
|
|
81
85
|
- lib/tramway/event/generators/templates/add_status_to_tramway_event_events.rb
|
|
82
86
|
- lib/tramway/event/generators/templates/create_tramway_event_events.rb
|
|
87
|
+
- lib/tramway/event/generators/templates/create_tramway_event_events_places.rb
|
|
83
88
|
- lib/tramway/event/generators/templates/create_tramway_event_participant_form_fields.rb
|
|
84
89
|
- lib/tramway/event/generators/templates/create_tramway_event_participants.rb
|
|
85
90
|
- lib/tramway/event/generators/templates/create_tramway_event_people.rb
|
|
86
91
|
- lib/tramway/event/generators/templates/create_tramway_event_people_sections.rb
|
|
92
|
+
- lib/tramway/event/generators/templates/create_tramway_event_places.rb
|
|
87
93
|
- lib/tramway/event/generators/templates/create_tramway_event_sections.rb
|
|
88
94
|
- lib/tramway/event/generators/templates/rebuild_association_between_participant_and_partakings_to_polymorphic.rb
|
|
89
95
|
- lib/tramway/event/generators/templates/rename_tramway_event_people_sections_to_tramway_event_partakings.rb
|
|
@@ -107,8 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
107
113
|
- !ruby/object:Gem::Version
|
|
108
114
|
version: '0'
|
|
109
115
|
requirements: []
|
|
110
|
-
|
|
111
|
-
rubygems_version: 2.7.6
|
|
116
|
+
rubygems_version: 3.0.3
|
|
112
117
|
signing_key:
|
|
113
118
|
specification_version: 4
|
|
114
119
|
summary: Rails engine for events
|