tramway-event 1.9.19.1 → 1.9.19.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 +4 -4
- data/Rakefile +3 -5
- data/app/controllers/tramway/event/application_controller.rb +2 -0
- data/app/controllers/tramway/event/events_controller.rb +2 -0
- data/app/controllers/tramway/event/participants_controller.rb +2 -0
- data/app/decorators/tramway/event/event_decorator.rb +16 -13
- data/app/decorators/tramway/event/event_link_decorator.rb +2 -0
- data/app/decorators/tramway/event/events/show/event_decorator.rb +4 -2
- data/app/decorators/tramway/event/partaking_decorator.rb +5 -3
- data/app/decorators/tramway/event/partaking_feature_decorator.rb +2 -0
- data/app/decorators/tramway/event/participant_decorator.rb +7 -5
- data/app/decorators/tramway/event/participant_form_field_decorator.rb +3 -1
- data/app/decorators/tramway/event/participant_xlsx_decorator.rb +3 -1
- data/app/decorators/tramway/event/person_decorator.rb +3 -1
- data/app/decorators/tramway/event/place_decorator.rb +2 -0
- data/app/decorators/tramway/event/section_decorator.rb +3 -1
- data/app/decorators/tramway/event/section_feature_decorator.rb +3 -1
- data/app/forms/tramway/event/event_form.rb +9 -7
- data/app/forms/tramway/event/partaking_form.rb +4 -2
- data/app/forms/tramway/event/participant_extended_form_creator.rb +2 -0
- data/app/forms/tramway/event/participant_form.rb +2 -0
- data/app/forms/tramway/event/participant_form_field_form.rb +2 -0
- data/app/forms/tramway/event/person_form.rb +5 -3
- data/app/forms/tramway/event/place_form.rb +6 -4
- data/app/forms/tramway/event/section_form.rb +3 -1
- data/app/helpers/tramway/event/application_helper.rb +3 -1
- data/app/jobs/tramway/event/application_job.rb +2 -0
- data/app/mailers/tramway/event/application_mailer.rb +2 -0
- data/app/models/tramway/event/application_record.rb +2 -0
- data/app/models/tramway/event/event.rb +4 -2
- data/app/models/tramway/event/partaking.rb +4 -2
- data/app/models/tramway/event/participant.rb +9 -7
- data/app/models/tramway/event/participant_form_field.rb +3 -1
- data/app/models/tramway/event/person.rb +2 -0
- data/app/models/tramway/event/place.rb +2 -0
- data/app/models/tramway/event/section.rb +2 -0
- data/config/initializers/assets.rb +3 -1
- data/config/initializers/tramway.rb +9 -7
- data/config/routes.rb +2 -0
- data/lib/tasks/tramway/event_tasks.rake +2 -0
- data/lib/tramway/event.rb +3 -1
- data/lib/tramway/event/engine.rb +2 -0
- data/lib/tramway/event/generators/install_generator.rb +4 -2
- data/lib/tramway/event/generators/templates/add_description_to_tramway_event_people.rb +2 -0
- data/lib/tramway/event/generators/templates/add_icon_to_tramway_event_sections.rb +2 -0
- data/lib/tramway/event/generators/templates/add_more_fields_to_tramway_event_participants.rb +2 -0
- data/lib/tramway/event/generators/templates/add_options_to_tramway_event_participant_form_fields.rb +2 -0
- data/lib/tramway/event/generators/templates/add_photo_to_tramway_event_events.rb +2 -0
- data/lib/tramway/event/generators/templates/add_position_to_tramway_event_partakings.rb +2 -0
- data/lib/tramway/event/generators/templates/add_position_to_tramway_event_participant_form_fields.rb +2 -0
- data/lib/tramway/event/generators/templates/add_position_to_tramway_event_sections.rb +2 -0
- data/lib/tramway/event/generators/templates/add_request_period_to_tramway_event_events.rb +2 -0
- data/lib/tramway/event/generators/templates/add_state_to_tramway_event_partakings.rb +2 -0
- data/lib/tramway/event/generators/templates/add_status_to_tramway_event_events.rb +2 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_events.rb +2 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_events_places.rb +2 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_participant_form_fields.rb +2 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_participants.rb +2 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_people.rb +2 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_people_sections.rb +2 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_places.rb +2 -0
- data/lib/tramway/event/generators/templates/create_tramway_event_sections.rb +2 -0
- data/lib/tramway/event/generators/templates/rebuild_association_between_participant_and_partakings_to_polymorphic.rb +2 -0
- data/lib/tramway/event/generators/templates/rename_tramway_event_people_sections_to_tramway_event_partakings.rb +2 -0
- data/lib/tramway/event/version.rb +3 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 2fa39c1639004038330bc20e061dde1b2737ebdd6e8029c6d067fa675d2112cc
|
|
4
|
+
data.tar.gz: dc24aa87fdc2346c96a34d98a38f0bb4569e94ad6805be93271e6a6fe789f0df
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 8809bdb33077e8dc9aded16ccfc98d8c894f5f1d0823802f7b211fdbd6ae352d218ba18d9a1200e6ca8706e3912dbac1c2a81b93cca75ae0e9c57a84aec61c49
|
|
7
|
+
data.tar.gz: e48bc4b4a56bfb11da3963564a59812854b35006ad70b762185c3749c9b64fffd0418c223e2e28ce620bf8123d384e04a1bda9c58329db1a3f735a95558df743
|
data/Rakefile
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
begin
|
|
2
4
|
require 'bundler/setup'
|
|
3
5
|
rescue LoadError
|
|
@@ -14,14 +16,11 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
|
14
16
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
15
17
|
end
|
|
16
18
|
|
|
17
|
-
APP_RAKEFILE = File.expand_path(
|
|
19
|
+
APP_RAKEFILE = File.expand_path('test/dummy/Rakefile', __dir__)
|
|
18
20
|
load 'rails/tasks/engine.rake'
|
|
19
21
|
|
|
20
|
-
|
|
21
22
|
load 'rails/tasks/statistics.rake'
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
24
|
require 'bundler/gem_tasks'
|
|
26
25
|
|
|
27
26
|
require 'rake/testtask'
|
|
@@ -32,5 +31,4 @@ Rake::TestTask.new(:test) do |t|
|
|
|
32
31
|
t.verbose = false
|
|
33
32
|
end
|
|
34
33
|
|
|
35
|
-
|
|
36
34
|
task default: :test
|
|
@@ -1,25 +1,27 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
|
|
2
4
|
class << self
|
|
3
5
|
def collections
|
|
4
|
-
[
|
|
6
|
+
[:all]
|
|
5
7
|
end
|
|
6
8
|
|
|
7
9
|
def show_attributes
|
|
8
|
-
[
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
%i[
|
|
11
|
+
title
|
|
12
|
+
duration
|
|
13
|
+
state
|
|
14
|
+
created_at
|
|
15
|
+
photo
|
|
16
|
+
status
|
|
17
|
+
request_collecting_duration
|
|
18
|
+
description
|
|
19
|
+
participants_list
|
|
18
20
|
]
|
|
19
21
|
end
|
|
20
22
|
|
|
21
23
|
def list_attributes
|
|
22
|
-
[
|
|
24
|
+
%i[requested_participants approved_participants]
|
|
23
25
|
end
|
|
24
26
|
end
|
|
25
27
|
|
|
@@ -56,7 +58,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
|
|
|
56
58
|
|
|
57
59
|
def duration(begin_date: object.begin_date, end_date: object.end_date)
|
|
58
60
|
if begin_date.to_date == end_date.to_date
|
|
59
|
-
|
|
61
|
+
I18n.l(begin_date, format: '%d %B %Y').to_s
|
|
60
62
|
elsif begin_date.month == end_date.month
|
|
61
63
|
"#{I18n.t('date.from')} #{I18n.l(begin_date, format: '%d')} #{I18n.t('date.to')} #{I18n.l(end_date, format: '%d %B %Y')}"
|
|
62
64
|
else
|
|
@@ -65,6 +67,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
|
|
|
65
67
|
end
|
|
66
68
|
|
|
67
69
|
def request_collecting_duration
|
|
70
|
+
return if object.request_collecting_begin_date.nil? || object.request_collecting_end_date.nil?
|
|
68
71
|
duration begin_date: object.request_collecting_begin_date, end_date: object.request_collecting_end_date
|
|
69
72
|
end
|
|
70
73
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::Events::Show::EventDecorator < ::Tramway::Core::ApplicationDecorator
|
|
2
4
|
class << self
|
|
3
5
|
def collections
|
|
4
|
-
[
|
|
6
|
+
[:all]
|
|
5
7
|
end
|
|
6
8
|
end
|
|
7
9
|
|
|
@@ -22,7 +24,7 @@ class Tramway::Event::Events::Show::EventDecorator < ::Tramway::Core::Applicatio
|
|
|
22
24
|
|
|
23
25
|
def duration
|
|
24
26
|
if object.begin_date.to_date == object.end_date.to_date
|
|
25
|
-
|
|
27
|
+
I18n.l(object.begin_date, format: '%d %B %Y').to_s
|
|
26
28
|
elsif object.begin_date.month == object.end_date.month
|
|
27
29
|
"#{I18n.t('date.from')} #{I18n.l(object.begin_date, format: '%d')} #{I18n.t('date.to')} #{I18n.l(object.end_date, format: '%d %B %Y')}"
|
|
28
30
|
else
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::PartakingDecorator < ::Tramway::Core::ApplicationDecorator
|
|
2
4
|
class << self
|
|
3
5
|
def collections
|
|
4
|
-
[
|
|
6
|
+
[:all]
|
|
5
7
|
end
|
|
6
8
|
|
|
7
9
|
def show_attributes
|
|
8
|
-
[
|
|
10
|
+
%i[part_name event_duration part_description]
|
|
9
11
|
end
|
|
10
12
|
end
|
|
11
13
|
|
|
@@ -14,7 +16,7 @@ class Tramway::Event::PartakingDecorator < ::Tramway::Core::ApplicationDecorator
|
|
|
14
16
|
def name
|
|
15
17
|
"#{object.person.first_name} #{object.person.last_name} - #{object.position}"
|
|
16
18
|
end
|
|
17
|
-
|
|
19
|
+
|
|
18
20
|
def part_name
|
|
19
21
|
part.name
|
|
20
22
|
end
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorator
|
|
2
4
|
include HTMLTagsHelpers
|
|
3
5
|
class << self
|
|
4
6
|
def collections
|
|
5
|
-
[
|
|
7
|
+
%i[requested waiting prev_approved without_answer approved rejected reserved all]
|
|
6
8
|
end
|
|
7
9
|
|
|
8
10
|
def list_attributes
|
|
@@ -34,11 +36,11 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
|
|
|
34
36
|
end)
|
|
35
37
|
object.event.participant_form_fields.map do |field|
|
|
36
38
|
hash = if field.options.is_a?(Hash)
|
|
37
|
-
field.options
|
|
39
|
+
field.options
|
|
38
40
|
else
|
|
39
41
|
begin
|
|
40
42
|
JSON.parse(field.options.present? ? field.options : '{}')
|
|
41
|
-
rescue => e
|
|
43
|
+
rescue StandardError => e
|
|
42
44
|
I18n.t('.invalid_field_with_error', e)
|
|
43
45
|
end
|
|
44
46
|
end
|
|
@@ -49,7 +51,7 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
|
|
|
49
51
|
field.title
|
|
50
52
|
end)
|
|
51
53
|
concat(content_tag(:td) do
|
|
52
|
-
value = object.values&.dig(
|
|
54
|
+
value = object.values&.dig(field.title)
|
|
53
55
|
if russian_phone_number?(value)
|
|
54
56
|
tel_tag value
|
|
55
57
|
else
|
|
@@ -74,7 +76,7 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
|
|
|
74
76
|
end)
|
|
75
77
|
concat(content_tag(:td) do
|
|
76
78
|
concat(if russian_phone_number?(value)
|
|
77
|
-
|
|
79
|
+
tel_tag value
|
|
78
80
|
else
|
|
79
81
|
value
|
|
80
82
|
end)
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::ParticipantXlsxDecorator < Tramway::Export::Xlsx::ApplicationDecorator
|
|
2
4
|
class << self
|
|
3
5
|
def columns
|
|
4
|
-
[
|
|
6
|
+
%i[full_name email phone organization event].map do |attribute|
|
|
5
7
|
{ Tramway::Event::Participant.human_attribute_name(attribute).to_sym => attribute }
|
|
6
8
|
end
|
|
7
9
|
end
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class ::Tramway::Event::SectionFeatureDecorator < ::Tramway::Landing::BlockTypes::FeaturesDecorator
|
|
2
4
|
delegate :icon, to: :object
|
|
3
5
|
delegate :title, to: :object
|
|
4
6
|
delegate :description, to: :object
|
|
5
7
|
|
|
6
8
|
def text
|
|
7
|
-
object.description.scan(
|
|
9
|
+
object.description.scan(%r{<strong>.*?</strong>}).join(' ')
|
|
8
10
|
end
|
|
9
11
|
|
|
10
12
|
def image
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
|
|
2
4
|
properties :title, :description, :begin_date, :end_date, :photo, :status,
|
|
3
5
|
:request_collecting_begin_date, :request_collecting_end_date
|
|
@@ -5,13 +7,13 @@ class Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
|
|
|
5
7
|
def initialize(object)
|
|
6
8
|
super(object).tap do
|
|
7
9
|
form_properties title: :string,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
10
|
+
description: :ckeditor,
|
|
11
|
+
begin_date: :date_picker,
|
|
12
|
+
end_date: :date_picker,
|
|
13
|
+
request_collecting_begin_date: :date_picker,
|
|
14
|
+
request_collecting_end_date: :date_picker,
|
|
15
|
+
photo: :file,
|
|
16
|
+
status: :default
|
|
15
17
|
end
|
|
16
18
|
end
|
|
17
19
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::PartakingForm < ::Tramway::Core::ApplicationForm
|
|
2
4
|
properties :part_id, :part_type, :person_id, :position
|
|
3
5
|
associations :person, :part
|
|
@@ -5,8 +7,8 @@ class Tramway::Event::PartakingForm < ::Tramway::Core::ApplicationForm
|
|
|
5
7
|
def initialize(object)
|
|
6
8
|
super(object).tap do
|
|
7
9
|
form_properties part: :polymorphic_association,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
+
person: :association,
|
|
11
|
+
position: :string
|
|
10
12
|
end
|
|
11
13
|
end
|
|
12
14
|
end
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::PersonForm < ::Tramway::Core::ApplicationForm
|
|
2
4
|
properties :first_name, :last_name, :photo, :description
|
|
3
5
|
|
|
4
6
|
def initialize(object)
|
|
5
7
|
super(object).tap do
|
|
6
8
|
form_properties first_name: :string,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
9
|
+
last_name: :string,
|
|
10
|
+
photo: :file,
|
|
11
|
+
description: :ckeditor
|
|
10
12
|
end
|
|
11
13
|
end
|
|
12
14
|
end
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::PlaceForm < Tramway::Core::ApplicationForm
|
|
2
4
|
properties :title, :description, :coordinates, :photo, :city
|
|
3
5
|
|
|
4
6
|
def initialize(object)
|
|
5
7
|
super(object).tap do
|
|
6
8
|
form_properties title: :string,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
description: :ckeditor,
|
|
10
|
+
coordinates: :string,
|
|
11
|
+
photo: :file,
|
|
12
|
+
city: :string
|
|
11
13
|
end
|
|
12
14
|
end
|
|
13
15
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::SectionForm < ::Tramway::Core::ApplicationForm
|
|
2
4
|
properties :event, :title, :description, :photo, :icon, :position
|
|
3
5
|
association :event
|
|
@@ -10,6 +12,6 @@ class Tramway::Event::SectionForm < ::Tramway::Core::ApplicationForm
|
|
|
10
12
|
photo: :file,
|
|
11
13
|
icon: :string,
|
|
12
14
|
position: :numeric
|
|
13
|
-
end
|
|
15
|
+
end
|
|
14
16
|
end
|
|
15
17
|
end
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
|
|
2
4
|
mount_uploader :photo, PhotoUploader
|
|
3
5
|
|
|
@@ -9,12 +11,12 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
|
|
|
9
11
|
has_many :organizations, as: :partners, through: :partnerships, class_name: 'Tramway::Partner::Organization'
|
|
10
12
|
has_and_belongs_to_many :places
|
|
11
13
|
|
|
12
|
-
enumerize :status, default: :common, in: [
|
|
14
|
+
enumerize :status, default: :common, in: %i[common main]
|
|
13
15
|
|
|
14
16
|
scope :main_event, -> { where(status: :main) }
|
|
15
17
|
scope :actual, -> { where 'end_date > ?', DateTime.now }
|
|
16
18
|
scope :past, -> { where 'end_date < ?', DateTime.now }
|
|
17
|
-
|
|
19
|
+
|
|
18
20
|
def request_collecting_state
|
|
19
21
|
return :not_initialized unless request_collecting_begin_date.present? || request_collecting_end_date.present?
|
|
20
22
|
return :will_begin_soon if request_collecting_begin_date > DateTime.now
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::Partaking < ::Tramway::Core::ApplicationRecord
|
|
2
4
|
belongs_to :part, polymorphic: true
|
|
3
|
-
enumerize :part_type, in: [
|
|
5
|
+
enumerize :part_type, in: ['Tramway::Event::Event', 'Tramway::Event::Section']
|
|
4
6
|
|
|
5
7
|
belongs_to :person, class_name: 'Tramway::Event::Person'
|
|
6
8
|
|
|
7
|
-
search_by :position, person: [
|
|
9
|
+
search_by :position, person: %i[first_name last_name description]
|
|
8
10
|
end
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::Participant < ::Tramway::Event::ApplicationRecord
|
|
2
4
|
belongs_to :event, class_name: 'Tramway::Event::Event'
|
|
3
|
-
|
|
5
|
+
|
|
4
6
|
state_machine :participation_state, initial: :requested do
|
|
5
7
|
state :requested
|
|
6
8
|
state :prev_approved
|
|
@@ -11,23 +13,23 @@ class Tramway::Event::Participant < ::Tramway::Event::ApplicationRecord
|
|
|
11
13
|
state :reserved
|
|
12
14
|
|
|
13
15
|
event :previous_approve do
|
|
14
|
-
transition [
|
|
16
|
+
transition %i[requested without_answer waiting] => :prev_approved
|
|
15
17
|
end
|
|
16
18
|
|
|
17
19
|
event :wait_for_decision do
|
|
18
|
-
transition [
|
|
20
|
+
transition %i[requested without_answer] => :waiting
|
|
19
21
|
end
|
|
20
22
|
|
|
21
23
|
event :reserve do
|
|
22
|
-
transition [
|
|
24
|
+
transition %i[requested without_answer waiting] => :reserved
|
|
23
25
|
end
|
|
24
26
|
|
|
25
27
|
event :reject do
|
|
26
|
-
transition [
|
|
28
|
+
transition %i[requested without_answer waiting prev_approved reserved] => :rejected
|
|
27
29
|
end
|
|
28
30
|
|
|
29
31
|
event :approve do
|
|
30
|
-
transition [
|
|
32
|
+
transition %i[prev_approved reserved requested] => :approved
|
|
31
33
|
end
|
|
32
34
|
|
|
33
35
|
event :not_got_answer do
|
|
@@ -35,7 +37,7 @@ class Tramway::Event::Participant < ::Tramway::Event::ApplicationRecord
|
|
|
35
37
|
end
|
|
36
38
|
|
|
37
39
|
event :return_to_requested do
|
|
38
|
-
transition [
|
|
40
|
+
transition %i[prev_approved rejected] => :requested
|
|
39
41
|
end
|
|
40
42
|
end
|
|
41
43
|
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
class Tramway::Event::ParticipantFormField < ::Tramway::Event::ApplicationRecord
|
|
2
4
|
belongs_to :event, class_name: 'Tramway::Event::Event'
|
|
3
5
|
|
|
4
|
-
enumerize :field_type, in: [
|
|
6
|
+
enumerize :field_type, in: %i[text string numeric date_picker select], default: :text
|
|
5
7
|
|
|
6
8
|
scope :inputs_list, -> { active.order(position: :asc) }
|
|
7
9
|
end
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
::Tramway::Admin.set_available_models(::Tramway::Event::Event,
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
::Tramway::Event::ParticipantFormField,
|
|
5
|
+
::Tramway::Event::Participant,
|
|
6
|
+
::Tramway::Event::Section,
|
|
7
|
+
::Tramway::Event::Person,
|
|
8
|
+
::Tramway::Event::Partaking,
|
|
9
|
+
::Tramway::Event::Place,
|
|
10
|
+
project: :event)
|
data/config/routes.rb
CHANGED
data/lib/tramway/event.rb
CHANGED
data/lib/tramway/event/engine.rb
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'rails/generators'
|
|
2
4
|
require 'tramway/core/generators/install_generator'
|
|
3
5
|
|
|
4
6
|
module Tramway::Event::Generators
|
|
5
7
|
class InstallGenerator < ::Tramway::Core::Generators::InstallGenerator
|
|
6
8
|
include Rails::Generators::Migration
|
|
7
|
-
source_root File.expand_path('
|
|
9
|
+
source_root File.expand_path('templates', __dir__)
|
|
8
10
|
|
|
9
11
|
def run_other_generators
|
|
10
12
|
generate 'tramway:partner:install'
|
|
@@ -36,7 +38,7 @@ module Tramway::Event::Generators
|
|
|
36
38
|
:add_position_to_tramway_event_partakings,
|
|
37
39
|
:add_state_to_tramway_event_partakings,
|
|
38
40
|
:add_more_fields_to_tramway_event_participants,
|
|
39
|
-
|
|
41
|
+
|
|
40
42
|
# NOTE must be removed until tramway-event 2.0
|
|
41
43
|
:rebuild_association_between_participant_and_partakings_to_polymorphic,
|
|
42
44
|
|
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.9.19.
|
|
4
|
+
version: 1.9.19.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: 2019-
|
|
11
|
+
date: 2019-11-06 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Rails engine for events
|
|
14
14
|
email:
|