tramway-event 1.6.4 → 1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/tramway/event/events_controller.rb +1 -0
- data/app/decorators/tramway/event/event_decorator.rb +1 -0
- data/app/forms/tramway/event/partaking_form.rb +3 -3
- data/app/models/tramway/event/event.rb +1 -0
- data/app/models/tramway/event/partaking.rb +3 -1
- data/app/models/tramway/event/section.rb +1 -1
- data/app/views/tramway/event/events/_show_page.html.haml +1 -0
- data/app/views/tramway/event/events/show.html.haml +1 -1
- data/config/locales/models.yml +7 -0
- data/lib/tramway/event/generators/install_generator.rb +4 -1
- data/lib/tramway/event/generators/templates/rebuild_association_between_participant_and_partakings_to_polymorphic.rb +8 -0
- data/lib/tramway/event/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37923a2a9773e2913ef0830b5d9f15bca800c1fecc90ac0a3347dbb45f759306
|
4
|
+
data.tar.gz: fc14669e2e6ae25608176ffbee418a68c6531e8f896157dfb4f6599991e6733a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5d7e2039ad6e6854cb2d4b1549348579b676bd0ff83689f8490b09cfd32a918a4ba6274795607879096c351c1458f41c64056dc48fad0f2b04549509001c940a
|
7
|
+
data.tar.gz: 7f0ff40f0e46d85ad589e0bd56edb11cc44e5017ee2ffd9959cca4e803d06f251650e72176c6a6a1beeff8edfb8420207147e6c1dbb5d5f123062b4b6423d42f
|
@@ -8,5 +8,6 @@ class Tramway::Event::EventsController < Tramway::Event::ApplicationController
|
|
8
8
|
@sections = @event.sections.order(position: :asc).map { |s| ::Tramway::Event::SectionDecorator.decorate s }
|
9
9
|
@footer = ::Tramway::Landing::BlockDecorator.decorate ::Tramway::Landing::Block.footer
|
10
10
|
@events = ::Tramway::Event::Event.active.map { |e| ::Tramway::Event::EventDecorator.decorate e }
|
11
|
+
@people_as_features = @event.partakings.map { |p| ::Tramway::Event::PartakingFeatureDecorator.decorate p }
|
11
12
|
end
|
12
13
|
end
|
@@ -9,6 +9,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
|
|
9
9
|
delegate :description, to: :object
|
10
10
|
delegate :participant_form_fields, to: :object
|
11
11
|
delegate :sections, to: :object
|
12
|
+
delegate :partakings, to: :object
|
12
13
|
decorate_association :participants
|
13
14
|
|
14
15
|
def background
|
@@ -1,10 +1,10 @@
|
|
1
1
|
class Tramway::Event::PartakingForm < ::Tramway::Core::ApplicationForm
|
2
|
-
properties :
|
3
|
-
associations :
|
2
|
+
properties :part_id, :part_type, :person_id, :position
|
3
|
+
associations :person, :part
|
4
4
|
|
5
5
|
def initialize(object)
|
6
6
|
super(object).tap do
|
7
|
-
form_properties
|
7
|
+
form_properties part: :polymorphic_association,
|
8
8
|
person: :association,
|
9
9
|
position: :string
|
10
10
|
end
|
@@ -4,6 +4,7 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
|
|
4
4
|
has_many :participants, class_name: 'Tramway::Event::Participant'
|
5
5
|
has_many :participant_form_fields, class_name: 'Tramway::Event::ParticipantFormField'
|
6
6
|
has_many :sections, class_name: 'Tramway::Event::Section'
|
7
|
+
has_many :partakings, as: :part, class_name: 'Tramway::Event::Partaking'
|
7
8
|
|
8
9
|
enumerize :status, default: :common, in: [ :common, :main ]
|
9
10
|
|
@@ -1,4 +1,6 @@
|
|
1
1
|
class Tramway::Event::Partaking < ::Tramway::Core::ApplicationRecord
|
2
|
-
belongs_to :
|
2
|
+
belongs_to :part, polymorphic: true
|
3
|
+
enumerize :part_type, in: [ 'Tramway::Event::Event', 'Tramway::Event::Section' ]
|
4
|
+
|
3
5
|
belongs_to :person, class_name: 'Tramway::Event::Person'
|
4
6
|
end
|
@@ -2,5 +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
|
+
has_many :partakings, as: :part, class_name: 'Tramway::Event::Partaking'
|
6
6
|
end
|
@@ -40,3 +40,4 @@
|
|
40
40
|
= render 'tramway/event/sections/show_page', section: section
|
41
41
|
- if index < sections.count - 1
|
42
42
|
%br
|
43
|
+
= render 'tramway/landing/blocks/templates/features_list', block: OpenStruct.new(title: "Оргкомитет", description: "", anchor: :organizers), collection: people_as_features, options: { image: { css: { class_name: 'circle' } } }
|
@@ -6,5 +6,5 @@
|
|
6
6
|
%li
|
7
7
|
= link_to event.title, event_path(event.id)
|
8
8
|
- content_for :body_content do
|
9
|
-
= render 'tramway/event/events/show_page', event: @event, sections: @sections, sections_as_features: @sections_as_features
|
9
|
+
= render 'tramway/event/events/show_page', event: @event, sections: @sections, sections_as_features: @sections_as_features, people_as_features: @people_as_features
|
10
10
|
= render "tramway/landing/blocks/block_types/footer", block: @footer
|
data/config/locales/models.yml
CHANGED
@@ -16,6 +16,13 @@ ru:
|
|
16
16
|
tramway/event/participant:
|
17
17
|
comment: Примечание
|
18
18
|
event: Мероприятие
|
19
|
+
tramway/event/section:
|
20
|
+
title: Название
|
21
|
+
description: Описание
|
22
|
+
event: Мероприятие
|
23
|
+
photo: Изображение
|
24
|
+
icon: Иконка
|
25
|
+
position: Позиция на странице мероприятия
|
19
26
|
cases:
|
20
27
|
tramway/event/event:
|
21
28
|
plural: мероприятия
|
@@ -34,7 +34,10 @@ module Tramway::Event::Generators
|
|
34
34
|
|
35
35
|
:add_position_to_tramway_event_partakings,
|
36
36
|
:add_state_to_tramway_event_partakings,
|
37
|
-
:add_more_fields_to_tramway_event_participants
|
37
|
+
:add_more_fields_to_tramway_event_participants,
|
38
|
+
|
39
|
+
# NOTE must be removed until tramway-event 2.0
|
40
|
+
:rebuild_association_between_participant_and_partakings_to_polymorphic
|
38
41
|
]
|
39
42
|
migrations.each do |migration|
|
40
43
|
migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
|
@@ -0,0 +1,8 @@
|
|
1
|
+
# NOTE must be removed until tramway-event 2.0
|
2
|
+
|
3
|
+
class RebuildAssociationBetweenParticipantAndPartakingsToPolymorphic < ActiveRecord::Migration[5.1]
|
4
|
+
def change
|
5
|
+
rename_column :tramway_event_partakings, :section_id, :part_id
|
6
|
+
add_column :tramway_event_partakings, :part_type, :text, default: 'Tramway::Event::Section'
|
7
|
+
end
|
8
|
+
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
|
+
version: '1.7'
|
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-
|
11
|
+
date: 2018-10-15 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails engine for events
|
14
14
|
email:
|
@@ -82,6 +82,7 @@ files:
|
|
82
82
|
- lib/tramway/event/generators/templates/create_tramway_event_people.rb
|
83
83
|
- lib/tramway/event/generators/templates/create_tramway_event_people_sections.rb
|
84
84
|
- lib/tramway/event/generators/templates/create_tramway_event_sections.rb
|
85
|
+
- lib/tramway/event/generators/templates/rebuild_association_between_participant_and_partakings_to_polymorphic.rb
|
85
86
|
- lib/tramway/event/generators/templates/rename_tramway_event_people_sections_to_tramway_event_partakings.rb
|
86
87
|
- lib/tramway/event/version.rb
|
87
88
|
homepage: https://github.com/ulmic/tramway-event
|