tramway-event 1.9.19.3 → 1.9.19.8

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: 9fd848d4774d69285cfa3c357b36834c18954c2b799e9e671184eaf833716f4f
4
- data.tar.gz: 43275c678bf421112bafea09343a92ef4002815f962387fc72bc25da3750b8dc
3
+ metadata.gz: 54e03b3c5e4f229932ec42064edffa9a69a244771d6206bff367ffdf78a2392e
4
+ data.tar.gz: 0ec7860ba8c4e3ee53a66b6cdde099c190b7797b2d28235d9838a6b6c5d2bc08
5
5
  SHA512:
6
- metadata.gz: 23f2a8c610c491f4bce5f1cd75e9cd9f7de29073d8bff369470003f9b54693b8ed0af2392eeb044bcad05fc4136e90555471a3b9fbd4b36e018a58d3c0446367
7
- data.tar.gz: d3bef7ce5d1d5b5baedd3631152f7f8bea340a25bc9ca258924d58c76d791a516dc4c25b39d823a1750605d104f726469019c1e8de2c938d03058d09f06648dc
6
+ metadata.gz: '0878b7c91b0decbce7c409f58da89c5dd1af2968618fa43cf265b9b1efc9cf74578086d1699803a8794f6805fdd7e153c78e215e3ce31451b0e8fc69eea7344c'
7
+ data.tar.gz: f14c9decc411b9fdbf2f3918ac0839ed38f6565bfd2f7be009faee9f8ff5b8a2b03d4d6b1e8a224fef970d1ab4f59f677c48b8f4fb2520f7cc0e48f3da1f21ad
data/README.md CHANGED
@@ -5,20 +5,40 @@ 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
+ gem 'carrierwave'
14
+ gem 'more_html_tags'
12
15
  ```
13
16
 
14
- And then execute:
17
+ #### 2. And then execute:
15
18
  ```bash
16
19
  $ bundle
17
20
  ```
18
21
 
19
- Or install it yourself as:
20
- ```bash
21
- $ gem install tramway-event
22
+ #### 3. Then run:
23
+ ```shell
24
+ rails g tramway:event:install
25
+ rails db:migrate
26
+ ```
27
+
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
31
+
32
+ *config/initializers/tramway.rb*
33
+ ```ruby
34
+ Tramway::Admin.set_available_models ::Tramway::Event::Event, ::Tramway::Event::ParticipantFormField, ::Tramway::Event::Participant, project: #{project_which_you_used_in_the_application}
35
+ ```
36
+
37
+ #### 6. Add events routes to the app
38
+
39
+ *config/routes.rb*
40
+ ```ruby
41
+ mount Tramway::Event::Engine, at: '/'
22
42
  ```
23
43
 
24
44
  ## Contributing
@@ -1 +1,4 @@
1
+ //= require tramway/core/application
1
2
  //= require_tree .
3
+
4
+ window.current_locale = window.i18n_locale('ru');
@@ -1,7 +1,7 @@
1
1
  @import 'bootstrap'
2
2
  @import 'tramway/core/application'
3
3
  @import 'tramway/landing/application'
4
- @import 'tramway/conference/application'
4
+ // @import 'tramway/conference/application'
5
5
 
6
6
  body
7
7
  margin: 0
@@ -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
@@ -14,8 +14,10 @@ class Tramway::Event::Events::Show::EventDecorator < ::Tramway::Core::Applicatio
14
14
  delegate :partakings, to: :object
15
15
  delegate :request_collecting_state, to: :object
16
16
 
17
- ::Tramway::Partner::Partnership.partnership_type.values.each do |partnership_type|
18
- decorate_association partnership_type.to_s.pluralize
17
+ if defined?(::Tramway::Partner)
18
+ ::Tramway::Partner::Partnership.partnership_type.values.each do |partnership_type|
19
+ decorate_association partnership_type.to_s.pluralize
20
+ end
19
21
  end
20
22
 
21
23
  def background
@@ -33,10 +35,12 @@ class Tramway::Event::Events::Show::EventDecorator < ::Tramway::Core::Applicatio
33
35
  end
34
36
 
35
37
  def partners
36
- @partners ||= ::Tramway::Partner::Partnership.partnership_type.values.reduce({}) do |hash, partnership_type|
37
- hash.merge! partnership_type => (object.send(partnership_type.to_s.pluralize).active.map do |partner|
38
- Tramway::Partner::OrganizationFeatureDecorator.decorate partner
39
- end)
38
+ if defined?(::Tramway::Partner)
39
+ @partners ||= ::Tramway::Partner::Partnership.partnership_type.values.reduce({}) do |hash, partnership_type|
40
+ hash.merge! partnership_type => (object.send(partnership_type.to_s.pluralize).active.map do |partner|
41
+ Tramway::Partner::OrganizationFeatureDecorator.decorate partner
42
+ end)
43
+ end
40
44
  end
41
45
  end
42
46
 
@@ -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
@@ -24,5 +24,7 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
24
24
  return :are_being_right_now if request_collecting_begin_date&.past? && request_collecting_end_date&.future?
25
25
  end
26
26
 
27
- include ::Tramway::Partner::Scopes
27
+ if defined? ::Tramway::Partner
28
+ include ::Tramway::Partner::Scopes
29
+ end
28
30
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class Tramway::Event::Person < ::Tramway::Event::ApplicationRecord
4
- has_and_belongs_to_many :sections, class_name: 'Tramway::Event::Section'
5
-
6
4
  mount_uploader :photo, PhotoUploader
7
5
  end
@@ -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]
@@ -1,5 +1,7 @@
1
1
  - content_for :title do
2
2
  = @event.title
3
+ - content_for :head_content do
4
+ = javascript_include_tag 'tramway/event/application'
3
5
  - content_for :footer_links do
4
6
  %ul
5
7
  - @events.each do |event|
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.9.19.3'
5
+ VERSION = '1.9.19.8'
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.3
4
+ version: 1.9.19.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-30 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: