tramway-event 1.5.1 → 1.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/decorators/tramway/event/partaking_decorator.rb +11 -0
- data/app/decorators/tramway/event/partaking_feature_decorator.rb +13 -0
- data/app/decorators/tramway/event/section_decorator.rb +4 -3
- data/app/forms/tramway/event/partaking_form.rb +12 -0
- data/app/forms/tramway/event/person_form.rb +2 -7
- data/app/models/tramway/event/partaking.rb +4 -0
- data/app/models/tramway/event/section.rb +1 -0
- data/app/views/tramway/event/events/_show_page.html.haml +1 -1
- data/app/views/tramway/event/sections/_show_page.html.haml +2 -0
- data/config/initializers/tramway.rb +1 -0
- data/config/locales/models.yml +5 -1
- data/lib/tramway/event/generators/install_generator.rb +7 -1
- data/lib/tramway/event/generators/templates/add_position_to_tramway_event_partakings.rb +5 -0
- data/lib/tramway/event/generators/templates/add_state_to_tramway_event_partakings.rb +5 -0
- data/lib/tramway/event/generators/templates/rename_tramway_event_people_sections_to_tramway_event_partakings.rb +7 -0
- data/lib/tramway/event/version.rb +1 -1
- metadata +10 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 03520a269ce5fdccb8d569dfa63c42f1148b0b5ad344d80bfbeb97db34db5c70
|
4
|
+
data.tar.gz: 76a7932edf7df8cf9c12177d0317f0ba4a0136b03c4d1b6cde3c9df31c1e8917
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1e9a9d5ef007d8a92f3a5fe23caeda6071b59fd3a04989b379521ecaa1b50442df629d877608edb888908ef2a3cfbe1d1b8779d24c32750e5a4cf63e3ad63e41
|
7
|
+
data.tar.gz: 77f83732c60a6e538ece1e58f736c3e5e34e55f23f2029893bdb94bfe710513a4b4af222b1cca1d5868e0ca4daded247a0d797ade5bc0b432682136275eb652a
|
@@ -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::
|
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
|
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
|
@@ -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/
|
39
|
+
= render 'tramway/event/sections/show_page', section: section
|
40
40
|
- if index < sections.count - 1
|
41
41
|
%br
|
data/config/locales/models.yml
CHANGED
@@ -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"
|
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.
|
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-
|
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:
|