tramway-event 1.11.0.1 → 1.11.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f27625a250dc36c6140e260f507e2423da7a883be89f9a88e59fac19de869069
4
- data.tar.gz: 3216e6d36b13502007cca14cf03a101e5a2784c20b4a8e5fe83c6b9d795bbe5b
3
+ metadata.gz: ea77a5e9957af8c76d807a94d3f1203b1085922f2c8a0c55fb44d5de40527977
4
+ data.tar.gz: e489de38c330b4863c18c01eaf8fda08fa717d60163a340a76e5c9f3362af4e1
5
5
  SHA512:
6
- metadata.gz: 30b7f594133dfcb4f45c88555728aaccf0fff41764614480e000606e7efa6547fb8e852bbfa7d09fdeb86cb9ffa71dee46685d26d7b289b32ca6f21d8632c1a9
7
- data.tar.gz: 803a55bf9dc48aa317e56450b33819f0cc2898b0c7a77151e59c20010634c2c7b5ac02388f20dd91c6728ced493e3d798f47b3064a88786b10e16da4d4052948
6
+ metadata.gz: df6b5e3111bf46c7e8312a716255ace9e2320f365e6ebb9a027b08896d3d228d6f7d95a2ae2a37d3f65f6e90d5bd41556c9dbfe68f9fe59156eaa8059ac9248a
7
+ data.tar.gz: f2475bafa4f3004d842a80c81ae465ceeae776eafb6a447c37b43d6a5408a61c949680abfc38c4828661473ec462e32179b6e08a8ec8795f1216948f5101b199
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Event::ActionDecorator < Tramway::Core::ApplicationDecorator
2
4
  class << self
3
5
  delegate :human_action_state_event_name, to: :model_class
@@ -7,7 +9,7 @@ class Tramway::Event::ActionDecorator < Tramway::Core::ApplicationDecorator
7
9
  def name
8
10
  "#{object.title} - #{date_view(object.deadline)} - #{state_machine_view(object, :action_state)}"
9
11
  end
10
-
12
+
11
13
  def action_state_button_color(event)
12
14
  case event
13
15
  when :do
@@ -36,7 +36,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
36
36
  decorate_association :partakings
37
37
  decorate_association :partnerships
38
38
  decorate_association :organizations
39
- decorate_association :actions, as: :event, state_machines: [ :action_state ]
39
+ decorate_association :actions, as: :event, state_machines: [:action_state]
40
40
 
41
41
  def background
42
42
  object.photo
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Admin::Tramway::Event::ActionForm < Tramway::Core::ApplicationForm
2
4
  properties :title, :action_state_event, :deadline
3
5
 
@@ -6,8 +8,8 @@ class Admin::Tramway::Event::ActionForm < Tramway::Core::ApplicationForm
6
8
  def initialize(object)
7
9
  super(object).tap do
8
10
  form_properties event: :association,
9
- title: :string,
10
- deadline: :date_picker
11
+ title: :string,
12
+ deadline: :date_picker
11
13
  end
12
14
  end
13
15
  end
@@ -12,7 +12,7 @@ class Admin::Tramway::Event::ParticipantForm < ::Tramway::Core::ApplicationForm
12
12
  SecureRandom.hex,
13
13
  object.event,
14
14
  participation_state_event: :default,
15
- comment: :string,
15
+ comment: :string
16
16
  ).new object
17
17
  else
18
18
  super(object).tap do |obj|
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class Tramway::Event::Action < Tramway::Core::ApplicationRecord
2
4
  belongs_to :event, class_name: 'Tramway::Event::Event'
3
5
 
@@ -15,7 +17,7 @@ class Tramway::Event::Action < Tramway::Core::ApplicationRecord
15
17
  end
16
18
 
17
19
  event :return do
18
- transition [ :declined, :done ] => :must_be_done
20
+ transition %i[declined done] => :must_be_done
19
21
  end
20
22
  end
21
23
  end
@@ -3,6 +3,15 @@
3
3
  class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
4
4
  mount_uploader :photo, PhotoUploader
5
5
 
6
+ validate :check_dimensions
7
+
8
+ def check_dimensions
9
+ if photo.present?
10
+ errors.add :photo, :too_small_image if photo.width < 1920 || photo.height < 1080
11
+ errors.add :photo, :image_aspect_ratio if photo.height / photo.width == 16 / 9
12
+ end
13
+ end
14
+
6
15
  has_many :participants, class_name: 'Tramway::Event::Participant'
7
16
  has_many :participant_form_fields, class_name: 'Tramway::Event::ParticipantFormField'
8
17
  has_many :sections, class_name: 'Tramway::Event::Section'
@@ -81,6 +81,11 @@ ru:
81
81
  deadline: Дедлайн
82
82
  errors:
83
83
  models:
84
+ tramway/event/event:
85
+ attributes:
86
+ photo:
87
+ too_small_image: слишком маленькое (минимальный размер изображения 1920*1080)
88
+ image_aspect_ratio: не соответствует формату (соотношение сторон должно быть 16 на 9)
84
89
  tramway/event/participant:
85
90
  attributes:
86
91
  default:
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.11.0.1'
5
+ VERSION = '1.11.1'
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.11.0.1
4
+ version: 1.11.1
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-03-04 00:00:00.000000000 Z
11
+ date: 2020-03-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: configus
@@ -135,7 +135,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
135
135
  - !ruby/object:Gem::Version
136
136
  version: '0'
137
137
  requirements: []
138
- rubygems_version: 3.0.3
138
+ rubygems_version: 3.1.2
139
139
  signing_key:
140
140
  specification_version: 4
141
141
  summary: Rails engine for events