tramway-event 1.12.3.8 → 1.12.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9c19a417bee52053352aba5e12c1b4e7021111e3be20ec3fccab8b3587ea476e
4
- data.tar.gz: ef7320eed1ed631cfc09491b165059c6d0b60731342735186ada038d29ad8f31
3
+ metadata.gz: 0c5cea79e8830c3db57b2657e8df6e27d0c09f6136fc96336760c2b84f05d225
4
+ data.tar.gz: 807718fa455cc0f29643e23a532b0bddec678cb2decdcd123e30ac6ffa7165f5
5
5
  SHA512:
6
- metadata.gz: dbfc98616a01483ecdf222ccb20b9d6d36262e9920e21c2ddc5fdc1a80951c229864ec2640248644d96971f8c6b822f9ddf613bd5c7f514742e8c9ca4997a4b9
7
- data.tar.gz: c7d0d7b0e767576552dd437f5319f8eea93def57b4b74e6576ab6cbf66cb1fb82accd764da8bcea2bd7743a4201cd6e1c082e3f9322b254f7f2a6ed8510708a5
6
+ metadata.gz: 3ef4fb14eef67149617974d2c2da311be4bb6de80944be5b92d6ee95745b3a6aa0b8e4d8c573fd77152d911f6b73c800409f39eafb42f75abf5a7bcb9311db44
7
+ data.tar.gz: 59660760d05f0667a9e759dad0ec9b9ea44f7e40d75477312eb466138244fce01ff292d6a0cca984d330269aff990b21ddf0c4ddf7d9fe6a9c6a25ca52cdc061
@@ -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 partakings]
15
15
  end
16
16
 
17
17
  def list_attributes
@@ -20,8 +20,10 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
20
20
  end
21
21
 
22
22
  delegate :title, to: :object
23
- decorate_associations :participants, :sections, :partakings, :partnerships, :organizations
23
+ decorate_associations :participants, :partnerships, :organizations
24
24
  decorate_association :participant_form_fields, as: :event
25
+ decorate_association :sections, as: :event
26
+ decorate_association :partakings, as: :part
25
27
  decorate_association :actions, as: :event, state_machines: [:action_state]
26
28
 
27
29
  def background
@@ -5,11 +5,15 @@ class Tramway::Event::SectionDecorator < ::Tramway::Landing::BlockTypes::Feature
5
5
  def collections
6
6
  [:all]
7
7
  end
8
+
9
+ def show_associations
10
+ [ :partakings ]
11
+ end
8
12
  end
9
13
 
10
14
  delegate :description, to: :object
11
15
  decorate_association :event
12
- decorate_association :partakings, decorator: Tramway::Event::PartakingFeatureDecorator
16
+ decorate_association :partakings, as: :part, decorator: Tramway::Event::PartakingFeatureDecorator
13
17
 
14
18
  def name
15
19
  "#{object.title} | #{object.event.title}"
@@ -8,6 +8,8 @@ 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
 
@@ -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, -> { where('begin_date > ?', DateTime.now).where('begin_date < ?', DateTime.now + 2.days) }
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
- .row.form
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
- - class_name = 'tramway_event_participant'
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
- = f.input :event_id, as: :hidden, input_html: { value: event.id, class: class_name, id: "#{class_name}_event_id", name: "#{class_name}[event_id]" }
9
- - event.participant_form_fields.inputs_list.each do |field|
10
- = render 'tramway/core/shared/input_extended', field: field, class_name: class_name, f: f, value: (params[:participant].present? ? params[:participant][field.title] : '')
11
- = f.button :submit, t('.submit_form')
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')
@@ -40,6 +40,7 @@ ru:
40
40
  short_description: Краткое описание
41
41
  actions: Действие
42
42
  reach: Доступность мероприятия
43
+ sections: События
43
44
  tramway/event/participant:
44
45
  name: Имя
45
46
  list_fields: Данные
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.12.3.8'
5
+ VERSION = '1.12.6'
6
6
  end
7
7
  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.12.3.8
4
+ version: 1.12.6
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-06-23 00:00:00.000000000 Z
11
+ date: 2020-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: configus