tramway-event 0.4.1 → 0.5
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/events_controller.rb +2 -0
- data/app/decorators/tramway/event/event_decorator.rb +1 -0
- data/app/decorators/tramway/event/participant_decorator.rb +7 -0
- data/app/decorators/tramway/event/participant_form_field_decorator.rb +7 -0
- data/app/forms/tramway/event/participant_form.rb +9 -0
- data/app/forms/tramway/event/participant_form_field_form.rb +16 -0
- data/app/models/tramway/event/event.rb +3 -0
- data/app/models/tramway/event/participant.rb +3 -0
- data/app/models/tramway/event/participant_form_field.rb +5 -0
- data/app/views/tramway/event/events/show.html.haml +2 -0
- data/app/views/tramway/event/participants/_form.html.haml +5 -0
- data/config/initializers/tramway.rb +4 -1
- data/config/locales/models.yml +8 -0
- data/config/routes.rb +1 -0
- data/lib/tramway/event/generators/install_generator.rb +2 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_participant_form_fields.rb +13 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_participants.rb +11 -0
- data/lib/tramway/event/version.rb +1 -1
- metadata +11 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 30a66f92c1d8f181b1620aa1a024178e479066e2dd015ab9994809ebeaca04f8
|
4
|
+
data.tar.gz: e1b97b81a35c3f3ce092f6e5a7ee2280637463947506d789a683e03e78916c6b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92b4b9d04b5bebd1f748caca9e94a7760bd41774cd79163d80ed1fe94f9f7084dfa223354b0375b66cb814b500d7ccdb961071daa186bdf41f704acb14f28d61
|
7
|
+
data.tar.gz: b11ca2ea6fdb17a8f5f7bd8e3c7b52bf04ee2a9cad08f6091fc62c26b5a05f399affc6a3912dd535bd3feeb01d35f3b135bf8ee0c53bec58a276e954cce3d6b3
|
@@ -3,5 +3,7 @@ class Tramway::Event::EventsController < Tramway::Event::ApplicationController
|
|
3
3
|
|
4
4
|
def show
|
5
5
|
@event = ::Tramway::Event::EventDecorator.decorate ::Tramway::Event::Event.find params[:id]
|
6
|
+
form_class = ::Tramway::Core::ExtendableForm.new "ParticipantExtendedForm#{request.uuid.gsub('-', '')}", *@event.participant_form_fields.map(&:title).map(&:to_sym)
|
7
|
+
@participant_form = form_class.new ::Tramway::Event::Participant.new
|
6
8
|
end
|
7
9
|
end
|
@@ -0,0 +1,16 @@
|
|
1
|
+
class Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ApplicationForm
|
2
|
+
properties :title, :description, :field_type, :event
|
3
|
+
|
4
|
+
def initialize(object)
|
5
|
+
form_object = super object
|
6
|
+
form_properties event: :association,
|
7
|
+
title: :string,
|
8
|
+
description: :string,
|
9
|
+
field_type: :default
|
10
|
+
form_object
|
11
|
+
end
|
12
|
+
|
13
|
+
def event=(value)
|
14
|
+
super ::Tramway::Event::Event.find value
|
15
|
+
end
|
16
|
+
end
|
data/config/locales/models.yml
CHANGED
@@ -2,6 +2,8 @@ ru:
|
|
2
2
|
activerecord:
|
3
3
|
models:
|
4
4
|
tramway/event/event: Мероприятие
|
5
|
+
tramway/event/participant: Участник
|
6
|
+
tramway/event/participant_form_field: Поле анкеты
|
5
7
|
attributes:
|
6
8
|
tramway/event/event:
|
7
9
|
title: Название
|
@@ -12,3 +14,9 @@ ru:
|
|
12
14
|
tramway/event/event:
|
13
15
|
plural: мероприятия
|
14
16
|
genitive: мероприятие
|
17
|
+
tramway/event/participant:
|
18
|
+
plural: участники
|
19
|
+
genitive: участника
|
20
|
+
tramway/event/participant_form_field:
|
21
|
+
plural: поля анкеты
|
22
|
+
genitive: поле анкеты
|
data/config/routes.rb
CHANGED
@@ -17,6 +17,8 @@ module Tramway::Event::Generators
|
|
17
17
|
def copy_migrations
|
18
18
|
migration_template 'create_tramway_event_events.rb', 'db/migrate/create_tramway_event_events.rb'
|
19
19
|
migration_template 'add_photo_to_tramway_event_events.rb', 'db/migrate/add_photo_to_tramway_event_events.rb'
|
20
|
+
migration_template 'create_tramway_event_participant_form_fields.rb', 'db/migrate/create_tramway_event_participant_form_fields.rb'
|
21
|
+
migration_template 'create_tramway_event_participants.rb', 'db/migrate/create_tramway_event_participants.rb'
|
20
22
|
end
|
21
23
|
end
|
22
24
|
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateTramwayEventParticipantFormFields < ActiveRecord::Migration[5.1]
|
2
|
+
def change
|
3
|
+
create_table :tramway_event_participant_form_fields do |t|
|
4
|
+
t.text :title
|
5
|
+
t.text :description
|
6
|
+
t.text :field_type, default: :text
|
7
|
+
t.integer :event_id
|
8
|
+
t.text :state, default: :active
|
9
|
+
|
10
|
+
t.timestamps
|
11
|
+
end
|
12
|
+
end
|
13
|
+
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: 0.
|
4
|
+
version: '0.5'
|
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-09-
|
11
|
+
date: 2018-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails engine for events
|
14
14
|
email:
|
@@ -28,13 +28,20 @@ files:
|
|
28
28
|
- app/controllers/tramway/event/events_controller.rb
|
29
29
|
- app/decorators/tramway/event/event_decorator.rb
|
30
30
|
- app/decorators/tramway/event/event_link_decorator.rb
|
31
|
+
- app/decorators/tramway/event/participant_decorator.rb
|
32
|
+
- app/decorators/tramway/event/participant_form_field_decorator.rb
|
31
33
|
- app/forms/tramway/event/event_form.rb
|
34
|
+
- app/forms/tramway/event/participant_form.rb
|
35
|
+
- app/forms/tramway/event/participant_form_field_form.rb
|
32
36
|
- app/helpers/tramway/event/application_helper.rb
|
33
37
|
- app/jobs/tramway/event/application_job.rb
|
34
38
|
- app/mailers/tramway/event/application_mailer.rb
|
35
39
|
- app/models/tramway/event/application_record.rb
|
36
40
|
- app/models/tramway/event/event.rb
|
41
|
+
- app/models/tramway/event/participant.rb
|
42
|
+
- app/models/tramway/event/participant_form_field.rb
|
37
43
|
- app/views/tramway/event/events/show.html.haml
|
44
|
+
- app/views/tramway/event/participants/_form.html.haml
|
38
45
|
- config/initializers/assets.rb
|
39
46
|
- config/initializers/tramway.rb
|
40
47
|
- config/locales/models.yml
|
@@ -45,6 +52,8 @@ files:
|
|
45
52
|
- lib/tramway/event/generators/install_generator.rb
|
46
53
|
- lib/tramway/event/generators/templates/add_photo_to_tramway_event_events.rb
|
47
54
|
- lib/tramway/event/generators/templates/create_tramway_event_events.rb
|
55
|
+
- lib/tramway/event/generators/templates/create_tramway_event_participant_form_fields.rb
|
56
|
+
- lib/tramway/event/generators/templates/create_tramway_event_participants.rb
|
48
57
|
- lib/tramway/event/version.rb
|
49
58
|
homepage: https://github.com/ulmic/tramway-event
|
50
59
|
licenses:
|