tramway-event 1.9.19.6 → 1.9.19.7

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: 30ef78204cd4ee382b3d6fe1f2ea0aee9a6a73dfa20763b7d7315b035dd66840
4
- data.tar.gz: 0f809850f6a465cc37bd40aea40ead15e884c5c6cbb1d0bc0c0010859bcce088
3
+ metadata.gz: ed1b88e09e03ede03bb8a2b8ab1c10c596bae453b37e2ffd3070ded3051dee77
4
+ data.tar.gz: 1dad8b0361b17e033a6c20773179e4c02d72599bf9b41cecee22b5fd96d87b2a
5
5
  SHA512:
6
- metadata.gz: e79568865d3c6cf054cde85248c3807da326d38fb64b1ca8428276bec75dc3f68821fac6dc8e9a07529caa36f5aa35f2662ec57ac591c33bbffd3278bf46d645
7
- data.tar.gz: 3f19ed519d3052c77806f16412ca89400b12db5285d496bb23d0b9ae7cd642ac2fc492b0b07139fd91f1b17804b5342e0110ae093ad438a9d5130609538387cd
6
+ metadata.gz: 2e717a1a19ee8148036002357a6f2c287664c55fa26b9148a9583c271e75f4e3584aa1087a13c79f638a5b3d8e5c2fd92832ffcd2b5a30ee0e1ed444c9c22de8
7
+ data.tar.gz: 4d07c12107eaecb01cea6bb87c3b811c330bf22df576e5cb4909325d333e091e30d609b43b16591db90baf6f76d72439919a010dc030027074bde54caba2f946
data/README.md CHANGED
@@ -5,7 +5,8 @@ Short description and motivation.
5
5
  How to use my plugin.
6
6
 
7
7
  ## Installation
8
- Add this line to your application's Gemfile:
8
+
9
+ #### 1. Add this line to your application's Gemfile:
9
10
 
10
11
  ```ruby
11
12
  gem 'tramway-event'
@@ -13,28 +14,33 @@ gem 'carrierwave'
13
14
  gem 'more_html_tags'
14
15
  ```
15
16
 
16
- And then execute:
17
+ #### 2. And then execute:
17
18
  ```bash
18
19
  $ bundle
19
20
  ```
20
- *Gemfile*
21
- ```ruby
22
- gem 'tramway-event'
23
- ```
24
21
 
25
- Then run:
22
+ #### 3. Then run:
26
23
  ```shell
27
24
  rails g tramway:event:install
28
25
  rails db:migrate
29
26
  ```
30
27
 
31
- Then make `tramway-landing` installation. [How-to](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/README.md#installation)
28
+ #### 4. Then make `tramway-landing` installation. [How-to](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/README.md#installation)
29
+
30
+ #### 5. Add events to admin panel
32
31
 
33
32
  *config/initializers/tramway.rb*
34
33
  ```ruby
35
34
  Tramway::Admin.set_available_models ::Tramway::Event::Event, ::Tramway::Event::ParticipantFormField, ::Tramway::Event::Participant, project: #{project_which_you_used_in_the_application}
36
35
  ```
37
36
 
37
+ #### 6. Add events routes to the app
38
+
39
+ *config/routes.rb*
40
+ ```ruby
41
+ mount Tramway::Event::Engine, at: '/'
42
+ ```
43
+
38
44
  ## Contributing
39
45
  Contribution directions go here.
40
46
 
@@ -12,10 +12,12 @@ class Tramway::Event::EventsController < Tramway::Event::ApplicationController
12
12
  @footer = ::Tramway::Landing::BlockDecorator.decorate ::Tramway::Landing::Block.footer
13
13
  @events = ::Tramway::Event::Event.active.actual.map { |e| ::Tramway::Event::Events::Show::EventDecorator.decorate e }
14
14
  @people_as_features = @event.partakings.active.map { |p| ::Tramway::Event::PartakingFeatureDecorator.decorate p }
15
- @partners = ::Tramway::Partner::Partnership.partnership_type.values.reduce({}) do |hash, partnership_type|
16
- hash.merge! partnership_type => (event.send(partnership_type.to_s.pluralize).active.map do |partner|
17
- Tramway::Partner::OrganizationFeatureDecorator.decorate partner
18
- end)
15
+ if defined?(::Tramway::Partner)
16
+ @partners = ::Tramway::Partner::Partnership.partnership_type.values.reduce({}) do |hash, partnership_type|
17
+ hash.merge! partnership_type => (event.send(partnership_type.to_s.pluralize).active.map do |partner|
18
+ Tramway::Partner::OrganizationFeatureDecorator.decorate partner
19
+ end)
20
+ end
19
21
  end
20
22
  end
21
23
  end
@@ -4,7 +4,7 @@ class Tramway::Event::ParticipantExtendedFormCreator < Tramway::Core::FormCreato
4
4
  def self.create_form_class(uuid, event, **simple_properties)
5
5
  class_name = "ParticipantExtendedForm#{uuid.gsub('-', '')}"
6
6
  properties = event.participant_form_fields.inputs_list.reduce({}) do |hash, field|
7
- hash.merge! field.title.to_sym => { object: field, validates: field.options['validations'] }
7
+ hash.merge! field.title.to_sym => { object: field, validates: field.options&.dig('validations') }
8
8
  end
9
9
  if simple_properties.keys.any?
10
10
  ::Tramway::Core::ExtendableForm.new(class_name, simple_properties: simple_properties, **properties)
@@ -5,14 +5,14 @@ class Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ApplicationFor
5
5
  association :event
6
6
 
7
7
  def initialize(object)
8
- form_object = super object
9
- form_properties event: :association,
10
- title: :string,
11
- description: :string,
12
- field_type: :default,
13
- options: :text,
14
- position: :numeric
15
- form_object
8
+ super(object).tap do
9
+ form_properties event: :association,
10
+ title: :string,
11
+ description: :string,
12
+ field_type: :default,
13
+ options: :text,
14
+ position: :numeric
15
+ end
16
16
  end
17
17
 
18
18
  def options
@@ -39,5 +39,6 @@
39
39
  - if index < sections.count - 1
40
40
  %br
41
41
  = render 'tramway/landing/blocks/templates/features_list', block: OpenStruct.new(title: "Оргкомитет", description: "", anchor: :organizers), collection: people_as_features, options: { image: { css: { class_name: 'circle' } } }
42
- - ::Tramway::Partner::Partnership.partnership_type.values.each do |partnership_type|
43
- = render 'tramway/landing/blocks/templates/features_list', block: OpenStruct.new(title: t("enumerize.tramway/partner/partnership.partnership_type.#{partnership_type}")), collection: partners[partnership_type]
42
+ - if defined? ::Tramway::Partner
43
+ - ::Tramway::Partner::Partnership.partnership_type.values.each do |partnership_type|
44
+ = render 'tramway/landing/blocks/templates/features_list', block: OpenStruct.new(title: t("enumerize.tramway/partner/partnership.partnership_type.#{partnership_type}")), collection: partners[partnership_type]
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.9.19.6'
5
+ VERSION = '1.9.19.7'
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.9.19.6
4
+ version: 1.9.19.7
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-01-11 00:00:00.000000000 Z
11
+ date: 2020-01-12 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for events
14
14
  email: