tramway-event 1.4 → 1.5

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: dcc54703252a31a5b2bc9195cbe54223b8ad244d28b7f33ae5fb46c220075fbb
4
- data.tar.gz: 9bf2eca69564a9f8ce2879b151f8da58c5a90abda08f67b5324a1f12c5ec22c5
3
+ metadata.gz: 282da529cbfd14070a3056924a6ed6e277d41f3166f5c121193847963fbca059
4
+ data.tar.gz: 8f10fa805fcc1809072bc3061b38dcd0401103607d1f1199fa46a5cc2882369c
5
5
  SHA512:
6
- metadata.gz: ec11fd14671032bf0886beda4628ce47a33f29142435609efab56844bc349f1c7211a4974b079eba95e9f952f4d8d814525517f23caad25655b647324bf042b2
7
- data.tar.gz: 1af2d5bfad864251ef6bbb9ec034d3cd92eacf4e9fe143e6df075067af41e2874c26580b6b11f9b2ea5084f3c72d2227e0829e2fc056532b9a6ada87ad86b633
6
+ metadata.gz: 04b16cf9695f7d9f0d00306feeab66f5db0b257854d4822ea3bb5031ddeefae5fb3b20656fc48f0acc1d6600176bc413398d57db7085801e0f0a4ce67beddc41
7
+ data.tar.gz: 3170d6c32b48a811ec70a57b9b11eeeaa343979da769a32f722f439212dae0b997a318b75601c4cbaf884102d63840f8bd09e8ca0629580a0c68d4a72d926769
@@ -0,0 +1,13 @@
1
+ class Tramway::Event::PersonDecorator < ::Tramway::Core::ApplicationDecorator
2
+ class << self
3
+ def collections
4
+ [ :all ]
5
+ end
6
+ end
7
+
8
+ decorate_association :sections
9
+
10
+ def name
11
+ "#{object.first_name} #{object.last_name}"
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ class Tramway::Event::PersonForm < ::Tramway::Core::ApplicationForm
2
+ properties :first_name, :last_name, :photo, :sections
3
+
4
+ def initialize(object)
5
+ super(object).tap do
6
+ form_properties first_name: :string,
7
+ last_name: :string,
8
+ photo: :file,
9
+ sections: :selectize
10
+ end
11
+ end
12
+
13
+ def sections=(value)
14
+ model.sections = ::Tramway::Event::Section.where id: value.split(',')
15
+ end
16
+ end
@@ -0,0 +1,5 @@
1
+ class Tramway::Event::Person < ::Tramway::Event::ApplicationRecord
2
+ has_and_belongs_to_many :sections, class_name: 'Tramway::Event::Section'
3
+
4
+ mount_uploader :photo, PhotoUploader
5
+ end
@@ -2,4 +2,5 @@
2
2
  ::Tramway::Event::ParticipantFormField,
3
3
  ::Tramway::Event::Participant,
4
4
  ::Tramway::Event::Section,
5
+ ::Tramway::Event::Person,
5
6
  project: :event)
@@ -5,6 +5,7 @@ ru:
5
5
  tramway/event/participant: Участник
6
6
  tramway/event/participant_form_field: Поле анкеты
7
7
  tramway/event/section: Секция
8
+ tramway/event/person: Член команды
8
9
  attributes:
9
10
  tramway/event/event:
10
11
  title: Название
@@ -24,3 +25,6 @@ ru:
24
25
  tramway/event/participant_form_field:
25
26
  plural: поля анкеты
26
27
  genitive: поле анкеты
28
+ tramway/event/person:
29
+ genitive: профиль члена команды
30
+ plural: Команда
@@ -15,16 +15,23 @@ module Tramway::Event::Generators
15
15
  end
16
16
 
17
17
  def copy_migrations
18
- migration_template 'create_tramway_event_events.rb', 'db/migrate/create_tramway_event_events.rb'
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'
22
- migration_template 'add_options_to_tramway_event_participant_form_fields.rb', 'db/migrate/add_options_to_tramway_event_participant_form_fields.rb'
23
- migration_template 'add_position_to_tramway_event_participant_form_fields.rb', 'db/migrate/add_position_to_tramway_event_participant_form_fields.rb'
24
- migration_template 'create_tramway_event_sections.rb', 'db/migrate/create_tramway_event_sections.rb'
25
- migration_template 'add_icon_to_tramway_event_sections.rb', 'db/migrate/add_icon_to_tramway_event_sections.rb'
26
- migration_template 'add_position_to_tramway_event_sections.rb', 'db/migrate/add_position_to_tramway_event_sections.rb'
27
- migration_template 'add_status_to_tramway_event_events.rb', 'db/migrate/add_status_to_tramway_event_events.rb'
18
+ migrations = [
19
+ :create_tramway_event_events,
20
+ :add_photo_to_tramway_event_events,
21
+ :create_tramway_event_participant_form_fields,
22
+ :create_tramway_event_participants,
23
+ :add_options_to_tramway_event_participant_form_fields,
24
+ :add_position_to_tramway_event_participant_form_fields,
25
+ :create_tramway_event_sections,
26
+ :add_icon_to_tramway_event_sections,
27
+ :add_position_to_tramway_event_sections,
28
+ :add_status_to_tramway_event_events,
29
+ :create_tramway_event_people,
30
+ :create_tramway_event_people_sections
31
+ ]
32
+ migrations.each do |migration|
33
+ migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
34
+ end
28
35
  end
29
36
  end
30
37
  end
@@ -0,0 +1,12 @@
1
+ class CreateTramwayEventPeople < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :tramway_event_people do |t|
4
+ t.text :first_name
5
+ t.text :last_name
6
+ t.text :photo
7
+ t.text :state, default: :active
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,10 @@
1
+ class CreateTramwayEventPeopleSections < ActiveRecord::Migration[5.1]
2
+ def change
3
+ create_table :tramway_event_people_sections do |t|
4
+ t.integer :section_id
5
+ t.integer :person_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Event
3
- VERSION = '1.4'
3
+ VERSION = '1.5'
4
4
  end
5
5
  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.4'
4
+ version: '1.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-26 00:00:00.000000000 Z
11
+ date: 2018-10-01 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for events
14
14
  email:
@@ -31,12 +31,14 @@ files:
31
31
  - app/decorators/tramway/event/event_link_decorator.rb
32
32
  - app/decorators/tramway/event/participant_decorator.rb
33
33
  - app/decorators/tramway/event/participant_form_field_decorator.rb
34
+ - app/decorators/tramway/event/person_decorator.rb
34
35
  - app/decorators/tramway/event/section_decorator.rb
35
36
  - app/decorators/tramway/event/section_feature_decorator.rb
36
37
  - app/forms/tramway/event/event_form.rb
37
38
  - app/forms/tramway/event/participant_extended_form_creator.rb
38
39
  - app/forms/tramway/event/participant_form.rb
39
40
  - app/forms/tramway/event/participant_form_field_form.rb
41
+ - app/forms/tramway/event/person_form.rb
40
42
  - app/forms/tramway/event/section_form.rb
41
43
  - app/helpers/tramway/event/application_helper.rb
42
44
  - app/jobs/tramway/event/application_job.rb
@@ -45,6 +47,7 @@ files:
45
47
  - app/models/tramway/event/event.rb
46
48
  - app/models/tramway/event/participant.rb
47
49
  - app/models/tramway/event/participant_form_field.rb
50
+ - app/models/tramway/event/person.rb
48
51
  - app/models/tramway/event/section.rb
49
52
  - app/views/tramway/event/events/_show_page.html.haml
50
53
  - app/views/tramway/event/events/show.html.haml
@@ -67,6 +70,8 @@ files:
67
70
  - lib/tramway/event/generators/templates/create_tramway_event_events.rb
68
71
  - lib/tramway/event/generators/templates/create_tramway_event_participant_form_fields.rb
69
72
  - lib/tramway/event/generators/templates/create_tramway_event_participants.rb
73
+ - lib/tramway/event/generators/templates/create_tramway_event_people.rb
74
+ - lib/tramway/event/generators/templates/create_tramway_event_people_sections.rb
70
75
  - lib/tramway/event/generators/templates/create_tramway_event_sections.rb
71
76
  - lib/tramway/event/version.rb
72
77
  homepage: https://github.com/ulmic/tramway-event