tramway-event 1.12.3.6 → 1.12.4
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/event_decorator.rb +3 -2
- data/app/helpers/tramway/event/application_helper.rb +1 -0
- data/app/models/tramway/event/event.rb +6 -2
- data/app/views/tramway/event/participants/_form.html.haml +12 -11
- data/config/locales/models.yml +1 -0
- data/lib/tramway/event/version.rb +1 -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: a9da09b01fa80ca0e68c1eb99562fce606ad2a666651eda6928006a41035f67f
|
4
|
+
data.tar.gz: 7da3f0013121edc1958396e6d13dea1921e1af880c95655189cab8b80c8a3c6a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71353d000dbbc4ebc2c5e15a955f001b6febaa974a0ad39a84acf4e9b763ae0b2cbfd721af778f733d7f693a532c8ed7f3dcaca50f8743526a5becc557ca47b0
|
7
|
+
data.tar.gz: 3fcc06181a67328fa4f997de517776603c043f24bcf2ff7d0fa81e831cd63debc45d14aa05d527f73293e31a3f7ba115a2c0403df46e2fc0c1a0566573899dd3
|
@@ -11,7 +11,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
|
|
11
11
|
end
|
12
12
|
|
13
13
|
def show_associations
|
14
|
-
%i[participant_form_fields actions]
|
14
|
+
%i[participant_form_fields actions sections]
|
15
15
|
end
|
16
16
|
|
17
17
|
def list_attributes
|
@@ -20,8 +20,9 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
|
|
20
20
|
end
|
21
21
|
|
22
22
|
delegate :title, to: :object
|
23
|
-
decorate_associations :participants, :
|
23
|
+
decorate_associations :participants, :partakings, :partnerships, :organizations
|
24
24
|
decorate_association :participant_form_fields, as: :event
|
25
|
+
decorate_association :sections, as: :event
|
25
26
|
decorate_association :actions, as: :event, state_machines: [:action_state]
|
26
27
|
|
27
28
|
def background
|
@@ -8,11 +8,13 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
|
|
8
8
|
def check_dimensions
|
9
9
|
if photo.present?
|
10
10
|
errors.add :photo, :too_small_image if photo.width.present? && (photo.width < 1920 || photo.height < 1080)
|
11
|
+
else
|
12
|
+
errors.add :photo, :is_not_present
|
11
13
|
end
|
12
14
|
end
|
13
15
|
|
14
16
|
has_many :participants, class_name: 'Tramway::Event::Participant'
|
15
|
-
has_many :participant_form_fields, class_name: 'Tramway::Event::ParticipantFormField'
|
17
|
+
has_many :participant_form_fields, -> { order(position: :asc) }, class_name: 'Tramway::Event::ParticipantFormField'
|
16
18
|
has_many :sections, class_name: 'Tramway::Event::Section'
|
17
19
|
has_many :partakings, as: :part, class_name: 'Tramway::Event::Partaking'
|
18
20
|
has_many :partnerships, class_name: 'Tramway::Partner::Partnership', as: :partner
|
@@ -22,7 +24,9 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
|
|
22
24
|
|
23
25
|
enumerize :reach, default: :open, in: %i[open closed]
|
24
26
|
|
25
|
-
scope :actual, ->
|
27
|
+
scope :actual, -> do
|
28
|
+
where('begin_date > ?', DateTime.now).or(where('begin_date < ? AND end_date > ?', DateTime.now, DateTime.now)).order(begin_date: :asc)
|
29
|
+
end
|
26
30
|
scope :past, -> { where 'end_date < ?', DateTime.now }
|
27
31
|
scope :open, -> { where reach: :open }
|
28
32
|
scope :closed, -> { where reach: :closed }
|
@@ -1,11 +1,12 @@
|
|
1
|
-
.
|
2
|
-
.
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
-
|
7
|
-
|
8
|
-
=
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
- unless event.request_collecting_state == :not_initialized
|
2
|
+
.row.form
|
3
|
+
.col-lg-12
|
4
|
+
%h1.text-center
|
5
|
+
= t(".request_collecting_state.#{event.request_collecting_state}")
|
6
|
+
- if event.request_collecting_state == :are_being_right_now && event.participant_form_fields.any?
|
7
|
+
- class_name = 'tramway_event_participant'
|
8
|
+
= 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|
|
9
|
+
= f.input :event_id, as: :hidden, input_html: { value: event.id, class: class_name, id: "#{class_name}_event_id", name: "#{class_name}[event_id]" }
|
10
|
+
- event.participant_form_fields.inputs_list.each do |field|
|
11
|
+
= render 'tramway/core/shared/input_extended', field: field, class_name: class_name, f: f, value: (params[:participant].present? ? params[:participant][field.title] : '')
|
12
|
+
= f.button :submit, t('.submit_form')
|
data/config/locales/models.yml
CHANGED
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.12.
|
4
|
+
version: 1.12.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Pavel Kalashnikov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-
|
11
|
+
date: 2020-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: configus
|