tramway-event 1.7.2 → 1.8
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/events/show/event_decorator.rb +1 -0
- data/app/forms/tramway/event/event_form.rb +4 -1
- data/app/models/tramway/event/event.rb +7 -0
- data/app/views/tramway/event/participants/_form.html.haml +5 -5
- data/config/locales/models.yml +2 -0
- data/config/locales/ru.yml +5 -0
- data/lib/tramway/event/generators/install_generator.rb +3 -1
- data/lib/tramway/event/generators/templates/add_request_period_to_tramway_event_events.rb +6 -0
- data/lib/tramway/event/version.rb +1 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: cf6bfbcbdb2405968e268be453c7e52e5eb71df572e667e8ee609c0c4a4ff6df
|
4
|
+
data.tar.gz: 11af62fd8af2727634243771f564397285d71c1109f75a1ae7d9461cfb683d72
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 931b4a3191c6dfa2eab6f2187f1eec5254416297128fa96de3ddafb49a3876c261f8e640dca0650bb54972f2e8060eff9c971ded1760540b5648bd2a680c55ad
|
7
|
+
data.tar.gz: cebc98e8d40d04d2b03c13b36f2d89ae2f8452f7df6654d40c03ced91d235d4b0a078f134d22a346b3ec0afd5a7c7750291e35c905acea48b9aab5143340c906
|
@@ -10,6 +10,7 @@ class Tramway::Event::Events::Show::EventDecorator < ::Tramway::Core::Applicatio
|
|
10
10
|
delegate :participant_form_fields, to: :object
|
11
11
|
delegate :sections, to: :object
|
12
12
|
delegate :partakings, to: :object
|
13
|
+
delegate :request_collecting_state, to: :object
|
13
14
|
|
14
15
|
def background
|
15
16
|
object.photo
|
@@ -1,5 +1,6 @@
|
|
1
1
|
class Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
|
2
|
-
properties :title, :description, :begin_date, :end_date, :photo, :status
|
2
|
+
properties :title, :description, :begin_date, :end_date, :photo, :status,
|
3
|
+
:request_collecting_begin_date, :request_collecting_end_date
|
3
4
|
|
4
5
|
def initialize(object)
|
5
6
|
form_object = super object
|
@@ -7,6 +8,8 @@ class Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
|
|
7
8
|
description: :ckeditor,
|
8
9
|
begin_date: :date_picker,
|
9
10
|
end_date: :date_picker,
|
11
|
+
request_collecting_begin_date: :date_picker,
|
12
|
+
request_collecting_end_date: :date_picker,
|
10
13
|
photo: :file,
|
11
14
|
status: :default
|
12
15
|
form_object
|
@@ -9,4 +9,11 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
|
|
9
9
|
enumerize :status, default: :common, in: [ :common, :main ]
|
10
10
|
|
11
11
|
scope :main_event, -> { where(status: :main) }
|
12
|
+
|
13
|
+
def request_collecting_state
|
14
|
+
return :not_initialized unless request_collecting_begin_date.present? || request_collecting_end_date.present?
|
15
|
+
return :will_begin_soon if request_collecting_begin_date > DateTime.now
|
16
|
+
return :is_over if request_collecting_end_date < DateTime.now
|
17
|
+
return :are_being_right_now if request_collecting_begin_date&.<(DateTime.now) && request_collecting_end_date&.>(DateTime.now)
|
18
|
+
end
|
12
19
|
end
|
@@ -1,8 +1,8 @@
|
|
1
|
-
|
2
|
-
.
|
3
|
-
.
|
4
|
-
|
5
|
-
|
1
|
+
.row
|
2
|
+
.col-lg-12
|
3
|
+
%h1.text-center
|
4
|
+
= t(".request_collecting_state.#{event.request_collecting_state}")
|
5
|
+
- if event.request_collecting_state == :are_being_right_now && event.participant_form_fields.any?
|
6
6
|
- class_name = 'tramway_event_participant'
|
7
7
|
= simple_form_for @participant_form, url: ::Tramway::Event::Engine.routes.url_helpers.participants_path, method: :post, html: { class: class_name, id: class_name } do |f|
|
8
8
|
= f.input :event_id, as: :hidden, input_html: { value: event.id, class: class_name, id: "#{class_name}_event_id", name: "#{class_name}[event_id]" }
|
data/config/locales/models.yml
CHANGED
@@ -13,6 +13,8 @@ ru:
|
|
13
13
|
description: Описание
|
14
14
|
begin_date: Дата начала
|
15
15
|
end_date: Дата конца
|
16
|
+
request_collecting_begin_date: Дата начала приёма заявок на мероприятие
|
17
|
+
request_collecting_end_date: Дата окончания приёма заявок на мероприятие
|
16
18
|
tramway/event/participant:
|
17
19
|
comment: Примечание
|
18
20
|
event: Мероприятие
|
data/config/locales/ru.yml
CHANGED
@@ -5,3 +5,8 @@ ru:
|
|
5
5
|
form:
|
6
6
|
registration: Регистрация на мероприятие
|
7
7
|
submit_form: Отправить заявку
|
8
|
+
request_collecting_state:
|
9
|
+
not_initialized: Сбор заявок не объявлен
|
10
|
+
will_begin_soon: Сбор заявок скоро начнётся
|
11
|
+
are_being_right_now: Сбор заявок на мероприятие
|
12
|
+
is_over: Сбор заявок завершён
|
@@ -37,7 +37,9 @@ module Tramway::Event::Generators
|
|
37
37
|
:add_more_fields_to_tramway_event_participants,
|
38
38
|
|
39
39
|
# NOTE must be removed until tramway-event 2.0
|
40
|
-
:rebuild_association_between_participant_and_partakings_to_polymorphic
|
40
|
+
:rebuild_association_between_participant_and_partakings_to_polymorphic,
|
41
|
+
|
42
|
+
:add_request_period_to_tramway_event_events
|
41
43
|
]
|
42
44
|
migrations.each do |migration|
|
43
45
|
migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tramway-event
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: '1.8'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
@@ -75,6 +75,7 @@ files:
|
|
75
75
|
- lib/tramway/event/generators/templates/add_position_to_tramway_event_partakings.rb
|
76
76
|
- lib/tramway/event/generators/templates/add_position_to_tramway_event_participant_form_fields.rb
|
77
77
|
- lib/tramway/event/generators/templates/add_position_to_tramway_event_sections.rb
|
78
|
+
- lib/tramway/event/generators/templates/add_request_period_to_tramway_event_events.rb
|
78
79
|
- lib/tramway/event/generators/templates/add_state_to_tramway_event_partakings.rb
|
79
80
|
- lib/tramway/event/generators/templates/add_status_to_tramway_event_events.rb
|
80
81
|
- lib/tramway/event/generators/templates/create_tramway_event_events.rb
|