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 +4 -4
- data/app/decorators/tramway/event/action_decorator.rb +3 -1
- data/app/decorators/tramway/event/event_decorator.rb +1 -1
- data/app/forms/admin/tramway/event/action_form.rb +4 -2
- data/app/forms/admin/tramway/event/participant_form.rb +1 -1
- data/app/models/tramway/event/action.rb +3 -1
- data/app/models/tramway/event/event.rb +9 -0
- data/config/locales/models.yml +5 -0
- data/lib/tramway/event/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ea77a5e9957af8c76d807a94d3f1203b1085922f2c8a0c55fb44d5de40527977
|
|
4
|
+
data.tar.gz: e489de38c330b4863c18c01eaf8fda08fa717d60163a340a76e5c9f3362af4e1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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: [
|
|
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
|
-
|
|
10
|
-
|
|
11
|
+
title: :string,
|
|
12
|
+
deadline: :date_picker
|
|
11
13
|
end
|
|
12
14
|
end
|
|
13
15
|
end
|
|
@@ -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 [
|
|
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'
|
data/config/locales/models.yml
CHANGED
|
@@ -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:
|
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.
|
|
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-
|
|
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.
|
|
138
|
+
rubygems_version: 3.1.2
|
|
139
139
|
signing_key:
|
|
140
140
|
specification_version: 4
|
|
141
141
|
summary: Rails engine for events
|