tramway-event 1.12.3.9 → 1.12.3.10

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: d16cb62030954f34b751e718ea4c6d9e6f674a9a5f819f2f77c72352e23a5522
4
- data.tar.gz: 3fce7c42f43263082bf4076dd5e0a4eaadbe252e1be83d481611e765b4276ab1
3
+ metadata.gz: dd47553c4b2de03f9bcb119c33f4ff67f5acdfd066b1b37149544da08c34d4c7
4
+ data.tar.gz: 546acb6986c03adf7c3ece913f2c85608c67b87d06626af355cf5358cff8d50c
5
5
  SHA512:
6
- metadata.gz: be1c3f5817c1920b5d455d0ba2d6b583d79fc0edd29d80d738c053df40cb474916f08a9075ab0d1ab11b1da5a8ef50c3103a8213eb6b6a20ecf0cf166c7b8849
7
- data.tar.gz: 8954b357e87e8035a1b6722696529993b52531088a74a42f160d190b7db78f2b94b2a1df811d07192462f0b98e1119590b19f660da1d1851f023258cb7674fbd
6
+ metadata.gz: 852ce423513c15988c7147f0ec3bf7434ca04df514c9b7415f960eda1b8ffd683f83777ea172e7e2357baf580c6e02f840f2ec76d414630df8246c6f17dee4c4
7
+ data.tar.gz: 83ff03e655e5631f05490a29a9bd84689cde5dc98b3f816bffb9a1301bc84809cceb87d234e8273ad0eb30c581c4a325791428b1a698f0505fe0fda6ed798067
@@ -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 + 11.days).order(begin_date: :asc) }
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')
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.12.3.9'
5
+ VERSION = '1.12.3.10'
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.9
4
+ version: 1.12.3.10
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-24 00:00:00.000000000 Z
11
+ date: 2020-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: configus