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 +4 -4
- data/README.md +25 -5
- data/app/assets/javascripts/tramway/event/application.js +3 -0
- data/app/assets/stylesheets/tramway/event/events/show.css.sass +1 -1
- data/app/controllers/tramway/event/events_controller.rb +6 -4
- data/app/decorators/tramway/event/events/show/event_decorator.rb +10 -6
- data/app/forms/tramway/event/participant_extended_form_creator.rb +1 -1
- data/app/forms/tramway/event/participant_form_field_form.rb +8 -8
- data/app/models/tramway/event/event.rb +3 -1
- data/app/models/tramway/event/person.rb +0 -2
- data/app/views/tramway/event/events/_show_page.html.haml +3 -2
- data/app/views/tramway/event/events/show.html.haml +2 -0
- data/lib/tramway/event/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 54e03b3c5e4f229932ec42064edffa9a69a244771d6206bff367ffdf78a2392e
|
4
|
+
data.tar.gz: 0ec7860ba8c4e3ee53a66b6cdde099c190b7797b2d28235d9838a6b6c5d2bc08
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
|
-
|
20
|
-
```
|
21
|
-
|
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
|
@@ -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
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
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
|
18
|
-
|
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
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
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
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
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
|
-
|
27
|
+
if defined? ::Tramway::Partner
|
28
|
+
include ::Tramway::Partner::Scopes
|
29
|
+
end
|
28
30
|
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
|
43
|
-
|
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]
|
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.
|
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:
|
11
|
+
date: 2020-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Rails engine for events
|
14
14
|
email:
|