tramway-event 1.10.2 → 1.11

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: ff89bd686ac28eff732d72cd490ea1d8f252f4ac29662522bc7ef429dbacfcf2
4
- data.tar.gz: f9b9f050ce693d5b1661a1aa3c58ef9274c3ab953c4cb051f4334201e0d6d7ac
3
+ metadata.gz: 2cfd11edc1d4bd496966576c24f63950098cab332bd971443fa7aa79b3b55eff
4
+ data.tar.gz: 81a313339af8f0bb7906f0c3d18e321b0a5adeaf5344cb91c380f845e8e94f82
5
5
  SHA512:
6
- metadata.gz: 5df609954218de5943a2cbe58a0e16545148750ea7a26378cf3ba2a817d45a3cba03a6395d967eeefc9fd6661091b421053a3d27a7fb40be1fe2fdf4d6081831
7
- data.tar.gz: 774f46bce3e89662224fc88dba5f112aee031680fda27d670bb6e5140f74b76918938eef3f0b2a438a9782198ba38a969e928e593c239ac4f1217ba2acdf52a0
6
+ metadata.gz: fcf396aa92c807b80bb3ea19f2f596d2017de47e60ca455c19e2b46a2d93ef43c3db019bfdcc14556aff7ed70b380a070d5dee36fd592d908cd882f984835e0c
7
+ data.tar.gz: 1d92fbc5baf1e6c3531ef19aa944583eb515eca606e86a1c96cc7e9eebde87601368dd7d0453184542d5190421d755d43e5f1014ff59aee27e9252c517e829a0
@@ -14,7 +14,6 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
14
14
  state
15
15
  created_at
16
16
  photo
17
- status
18
17
  request_collecting_duration
19
18
  description
20
19
  participants_list
@@ -31,7 +30,6 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
31
30
  end
32
31
 
33
32
  delegate :title, to: :object
34
- delegate :status, to: :object
35
33
  decorate_association :participants
36
34
  decorate_association :participant_form_fields, as: :event
37
35
  decorate_association :sections
@@ -110,9 +108,5 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
110
108
  state_machine_view object, :state
111
109
  end
112
110
 
113
- def status
114
- enumerize_view object.status
115
- end
116
-
117
111
  alias tagline duration
118
112
  end
@@ -1,20 +1,14 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Admin::Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
4
- properties :title, :description, :begin_date, :end_date, :photo, :status,
4
+ properties :title, :description, :begin_date, :end_date, :photo, :reach,
5
5
  :request_collecting_begin_date, :request_collecting_end_date, :short_description
6
6
 
7
7
  def initialize(object)
8
8
  super(object).tap do
9
- form_properties title: :string,
10
- short_description: :text,
11
- description: :ckeditor,
12
- begin_date: :date_picker,
13
- end_date: :date_picker,
14
- request_collecting_begin_date: :date_picker,
15
- request_collecting_end_date: :date_picker,
16
- photo: :file,
17
- status: :default
9
+ form_properties title: :string, short_description: :text, description: :ckeditor, begin_date: :date_picker,
10
+ end_date: :date_picker, request_collecting_begin_date: :date_picker,
11
+ request_collecting_end_date: :date_picker, photo: :file, reach: :default
18
12
  end
19
13
  end
20
14
  end
@@ -12,11 +12,12 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
12
12
  has_many :actions, -> { order(id: :asc) }, class_name: 'Tramway::Event::Action'
13
13
  has_and_belongs_to_many :places
14
14
 
15
- enumerize :status, default: :common, in: %i[common main]
15
+ enumerize :reach, default: :open, in: %i[open closed]
16
16
 
17
- scope :main_event, -> { active.where(status: :main) }
18
17
  scope :actual, -> { order(:begin_date).where('end_date > ?', DateTime.now) }
19
18
  scope :past, -> { where 'end_date < ?', DateTime.now }
19
+ scope :open, -> { where reach: :open }
20
+ scope :closed, -> { where reach: :closed }
20
21
 
21
22
  def request_collecting_state
22
23
  return :not_initialized unless request_collecting_begin_date.present? || request_collecting_end_date.present?
@@ -22,10 +22,9 @@
22
22
  = tel_tag @event.responsible_person[:phone] || @application.phone
23
23
  или пишите на email
24
24
  = mail_to @event.responsible_person[:email] || @application.email
25
- - if request.path == ::Tramway::Event::Engine.routes.url_helpers.event_path(event.id)
26
- = render 'tramway/landing/blocks/templates/full_page', block: event, buttons: [OpenStruct.new(title: t('.registration'), anchor: '#registration')]
27
- - content_for :main_image do
28
- = request.protocol + request.host_with_port + event.background.url
25
+ = render 'tramway/landing/blocks/templates/full_page', block: event, buttons: [OpenStruct.new(title: t('.registration'), anchor: '#registration')]
26
+ - content_for :main_image do
27
+ = request.protocol + request.host_with_port + event.background.url
29
28
  %main.event.show
30
29
  .container
31
30
  - if defined? sections_as_features
@@ -48,7 +48,11 @@ module Tramway::Event::Generators
48
48
  :create_tramway_event_places,
49
49
  :create_tramway_event_events_places,
50
50
  :add_short_description_to_tramway_event_events,
51
- :create_tramway_event_actions
51
+ :create_tramway_event_actions,
52
+ :add_reach_to_tramway_event_events,
53
+
54
+ # NOTE must be removed until tramway-event 2.0
55
+ :remove_status_from_tramway_event_events
52
56
  ]
53
57
  migrations.each do |migration|
54
58
  migration_template "#{migration}.rb", "db/migrate/#{migration}.rb"
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class AddReachToTramwayEventEvents < ActiveRecord::Migration[5.1]
4
+ def change
5
+ add_column :tramway_event_events, :reach, :text
6
+ end
7
+ end
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ class RemoveStatusFromTramwayEventEvents < ActiveRecord::Migration[5.1]
4
+ def change
5
+ remove_column :tramway_event_events, :status
6
+ end
7
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.10.2'
5
+ VERSION = '1.11'
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.10.2
4
+ version: '1.11'
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-03 00:00:00.000000000 Z
11
+ date: 2020-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: configus
@@ -98,6 +98,7 @@ files:
98
98
  - lib/tramway/event/generators/templates/add_position_to_tramway_event_partakings.rb
99
99
  - lib/tramway/event/generators/templates/add_position_to_tramway_event_participant_form_fields.rb
100
100
  - lib/tramway/event/generators/templates/add_position_to_tramway_event_sections.rb
101
+ - lib/tramway/event/generators/templates/add_reach_to_tramway_event_events.rb
101
102
  - lib/tramway/event/generators/templates/add_request_period_to_tramway_event_events.rb
102
103
  - lib/tramway/event/generators/templates/add_short_description_to_tramway_event_events.rb
103
104
  - lib/tramway/event/generators/templates/add_state_to_tramway_event_partakings.rb
@@ -112,6 +113,7 @@ files:
112
113
  - lib/tramway/event/generators/templates/create_tramway_event_places.rb
113
114
  - lib/tramway/event/generators/templates/create_tramway_event_sections.rb
114
115
  - lib/tramway/event/generators/templates/rebuild_association_between_participant_and_partakings_to_polymorphic.rb
116
+ - lib/tramway/event/generators/templates/remove_status_from_tramway_event_events.rb
115
117
  - lib/tramway/event/generators/templates/rename_tramway_event_people_sections_to_tramway_event_partakings.rb
116
118
  - lib/tramway/event/version.rb
117
119
  homepage: https://github.com/ulmic/tramway-event