tramway-event 1.5.1 → 1.5.2

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e55d7d6f84e56f8801bbb4e6855a92cc8d1c61dd1f9c596f2fbffd7e71487086
4
- data.tar.gz: c215a0fd30114aa14ec84135e49465105f349fa43eed94b5b778901c0662e3b7
3
+ metadata.gz: 03520a269ce5fdccb8d569dfa63c42f1148b0b5ad344d80bfbeb97db34db5c70
4
+ data.tar.gz: 76a7932edf7df8cf9c12177d0317f0ba4a0136b03c4d1b6cde3c9df31c1e8917
5
5
  SHA512:
6
- metadata.gz: 7955aacd424d797bd0074dd25cd032cbf20a9c0080f55ca06c7c154badd2f214a0f7d70892e624ca9115a879a76e1bc06bf4738f05c935b535fdd201465f347d
7
- data.tar.gz: fb8405966ae60ffc9ecde5db93d9321960c1e9fd77ae61cf184f087dc56d6f97695446bca232b11caf09eb38269488d3032f59705e2a0683d620b0cdbd629c43
6
+ metadata.gz: 1e9a9d5ef007d8a92f3a5fe23caeda6071b59fd3a04989b379521ecaa1b50442df629d877608edb888908ef2a3cfbe1d1b8779d24c32750e5a4cf63e3ad63e41
7
+ data.tar.gz: 77f83732c60a6e538ece1e58f736c3e5e34e55f23f2029893bdb94bfe710513a4b4af222b1cca1d5868e0ca4daded247a0d797ade5bc0b432682136275eb652a
@@ -0,0 +1,11 @@
1
+ class Tramway::Event::PartakingDecorator < ::Tramway::Core::ApplicationDecorator
2
+ class << self
3
+ def collections
4
+ [ :all ]
5
+ end
6
+ end
7
+
8
+ def name
9
+ "#{object.person.first_name} #{object.person.last_name} - #{object.position}"
10
+ end
11
+ end
@@ -0,0 +1,13 @@
1
+ class ::Tramway::Event::PartakingFeatureDecorator < ::Tramway::Landing::BlockTypes::FeaturesDecorator
2
+ def text
3
+ object.position&.html_safe
4
+ end
5
+
6
+ def title
7
+ "#{object.person.first_name} #{object.person.last_name}"
8
+ end
9
+
10
+ def image
11
+ object.person.photo.small.url
12
+ end
13
+ end
@@ -1,16 +1,17 @@
1
- class Tramway::Event::SectionDecorator < ::Tramway::Core::ApplicationDecorator
1
+ class Tramway::Event::SectionDecorator < ::Tramway::Landing::BlockTypes::FeaturesDecorator
2
2
  class << self
3
3
  def collections
4
4
  [ :all ]
5
5
  end
6
6
  end
7
7
 
8
+ delegate :description, to: :object
9
+ decorate_association :partakings, decorator: Tramway::Event::PartakingFeatureDecorator
10
+
8
11
  def title
9
12
  "#{fa_icon(object.icon)} #{object.title}".html_safe
10
13
  end
11
14
 
12
- delegate :description, to: :object
13
-
14
15
  def background
15
16
  object.photo
16
17
  end
@@ -0,0 +1,12 @@
1
+ class Tramway::Event::PartakingForm < ::Tramway::Core::ApplicationForm
2
+ properties :section_id, :person_id, :position
3
+ associations :section, :person
4
+
5
+ def initialize(object)
6
+ super(object).tap do
7
+ form_properties section: :association,
8
+ person: :association,
9
+ position: :string
10
+ end
11
+ end
12
+ end
@@ -1,16 +1,11 @@
1
1
  class Tramway::Event::PersonForm < ::Tramway::Core::ApplicationForm
2
- properties :first_name, :last_name, :photo, :sections
2
+ properties :first_name, :last_name, :photo
3
3
 
4
4
  def initialize(object)
5
5
  super(object).tap do
6
6
  form_properties first_name: :string,
7
7
  last_name: :string,
8
- photo: :file,
9
- sections: :selectize
8
+ photo: :file
10
9
  end
11
10
  end
12
-
13
- def sections=(value)
14
- model.sections = ::Tramway::Event::Section.where id: value.split(',')
15
- end
16
11
  end
@@ -0,0 +1,4 @@
1
+ class Tramway::Event::Partaking < ::Tramway::Core::ApplicationRecord
2
+ belongs_to :section, class_name: 'Tramway::Event::Section'
3
+ belongs_to :person, class_name: 'Tramway::Event::Person'
4
+ end
@@ -2,4 +2,5 @@ class Tramway::Event::Section < ::Tramway::Event::ApplicationRecord
2
2
  mount_uploader :photo, PhotoUploader
3
3
 
4
4
  belongs_to :event, class_name: 'Tramway::Event::Event'
5
+ has_many :partakings, class_name: 'Tramway::Event::Partaking'
5
6
  end
@@ -36,6 +36,6 @@
36
36
  = render 'tramway/event/participants/form', event: event
37
37
  %br
38
38
  - sections.each_with_index do |section, index|
39
- = render 'tramway/landing/blocks/templates/section_with_image_and_text', block: section
39
+ = render 'tramway/event/sections/show_page', section: section
40
40
  - if index < sections.count - 1
41
41
  %br
@@ -0,0 +1,2 @@
1
+ = render 'tramway/landing/blocks/templates/section_with_image_and_text', block: section
2
+ = render 'tramway/landing/blocks/templates/features_list', collection: section.partakings, options: { image: { css: { class_name: 'circle' } } }
@@ -3,4 +3,5 @@
3
3
  ::Tramway::Event::Participant,
4
4
  ::Tramway::Event::Section,
5
5
  ::Tramway::Event::Person,
6
+ ::Tramway::Event::Partaking,
6
7
  project: :event)
@@ -6,6 +6,7 @@ ru:
6
6
  tramway/event/participant_form_field: Поле анкеты
7
7
  tramway/event/section: Секция
8
8
  tramway/event/person: Член команды
9
+ tramway/event/partaking: Должность
9
10
  attributes:
10
11
  tramway/event/event:
11
12
  title: Название
@@ -27,4 +28,7 @@ ru:
27
28
  genitive: поле анкеты
28
29
  tramway/event/person:
29
30
  genitive: профиль члена команды
30
- plural: Команда
31
+ plural: члены команды
32
+ tramway/event/partaking:
33
+ genitive: должность
34
+ plural: должности
@@ -27,7 +27,13 @@ module Tramway::Event::Generators
27
27
  :add_position_to_tramway_event_sections,
28
28
  :add_status_to_tramway_event_events,
29
29
  :create_tramway_event_people,
30
- :create_tramway_event_people_sections
30
+ :create_tramway_event_people_sections,
31
+
32
+ # NOTE must be removed until tramway-event 2.0
33
+ :rename_tramway_event_people_sections_to_tramway_event_partakings,
34
+
35
+ :add_position_to_tramway_event_partakings,
36
+ :add_state_to_tramway_event_partakings
31
37
  ]
32
38
  migrations.each do |migration|
33
39
  migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
@@ -0,0 +1,5 @@
1
+ class AddPositionToTramwayEventPartakings < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :tramway_event_partakings, :position, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddStateToTramwayEventPartakings < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :tramway_event_partakings, :state, :text
4
+ end
5
+ end
@@ -0,0 +1,7 @@
1
+ # NOTE must be removed until tramway-event 2.0
2
+
3
+ class RenameTramwayEventPeopleSectionsToTramwayEventPartakings < ActiveRecord::Migration[5.1]
4
+ def change
5
+ rename_table :tramway_event_people_sections, :tramway_event_partakings
6
+ end
7
+ end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Event
3
- VERSION = '1.5.1'
3
+ VERSION = '1.5.2'
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.5.1
4
+ version: 1.5.2
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-10-02 00:00:00.000000000 Z
11
+ date: 2018-10-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for events
14
14
  email:
@@ -29,12 +29,15 @@ files:
29
29
  - app/controllers/tramway/event/participants_controller.rb
30
30
  - app/decorators/tramway/event/event_decorator.rb
31
31
  - app/decorators/tramway/event/event_link_decorator.rb
32
+ - app/decorators/tramway/event/partaking_decorator.rb
33
+ - app/decorators/tramway/event/partaking_feature_decorator.rb
32
34
  - app/decorators/tramway/event/participant_decorator.rb
33
35
  - app/decorators/tramway/event/participant_form_field_decorator.rb
34
36
  - app/decorators/tramway/event/person_decorator.rb
35
37
  - app/decorators/tramway/event/section_decorator.rb
36
38
  - app/decorators/tramway/event/section_feature_decorator.rb
37
39
  - app/forms/tramway/event/event_form.rb
40
+ - app/forms/tramway/event/partaking_form.rb
38
41
  - app/forms/tramway/event/participant_extended_form_creator.rb
39
42
  - app/forms/tramway/event/participant_form.rb
40
43
  - app/forms/tramway/event/participant_form_field_form.rb
@@ -45,6 +48,7 @@ files:
45
48
  - app/mailers/tramway/event/application_mailer.rb
46
49
  - app/models/tramway/event/application_record.rb
47
50
  - app/models/tramway/event/event.rb
51
+ - app/models/tramway/event/partaking.rb
48
52
  - app/models/tramway/event/participant.rb
49
53
  - app/models/tramway/event/participant_form_field.rb
50
54
  - app/models/tramway/event/person.rb
@@ -52,6 +56,7 @@ files:
52
56
  - app/views/tramway/event/events/_show_page.html.haml
53
57
  - app/views/tramway/event/events/show.html.haml
54
58
  - app/views/tramway/event/participants/_form.html.haml
59
+ - app/views/tramway/event/sections/_show_page.html.haml
55
60
  - config/initializers/assets.rb
56
61
  - config/initializers/tramway.rb
57
62
  - config/locales/models.yml
@@ -64,8 +69,10 @@ files:
64
69
  - lib/tramway/event/generators/templates/add_icon_to_tramway_event_sections.rb
65
70
  - lib/tramway/event/generators/templates/add_options_to_tramway_event_participant_form_fields.rb
66
71
  - lib/tramway/event/generators/templates/add_photo_to_tramway_event_events.rb
72
+ - lib/tramway/event/generators/templates/add_position_to_tramway_event_partakings.rb
67
73
  - lib/tramway/event/generators/templates/add_position_to_tramway_event_participant_form_fields.rb
68
74
  - lib/tramway/event/generators/templates/add_position_to_tramway_event_sections.rb
75
+ - lib/tramway/event/generators/templates/add_state_to_tramway_event_partakings.rb
69
76
  - lib/tramway/event/generators/templates/add_status_to_tramway_event_events.rb
70
77
  - lib/tramway/event/generators/templates/create_tramway_event_events.rb
71
78
  - lib/tramway/event/generators/templates/create_tramway_event_participant_form_fields.rb
@@ -73,6 +80,7 @@ files:
73
80
  - lib/tramway/event/generators/templates/create_tramway_event_people.rb
74
81
  - lib/tramway/event/generators/templates/create_tramway_event_people_sections.rb
75
82
  - lib/tramway/event/generators/templates/create_tramway_event_sections.rb
83
+ - lib/tramway/event/generators/templates/rename_tramway_event_people_sections_to_tramway_event_partakings.rb
76
84
  - lib/tramway/event/version.rb
77
85
  homepage: https://github.com/ulmic/tramway-event
78
86
  licenses: