tramway-event 1.9.19.6 → 1.9.19.7
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/README.md +14 -8
- data/app/controllers/tramway/event/events_controller.rb +6 -4
- 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/views/tramway/event/events/_show_page.html.haml +3 -2
- 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: ed1b88e09e03ede03bb8a2b8ab1c10c596bae453b37e2ffd3070ded3051dee77
|
|
4
|
+
data.tar.gz: 1dad8b0361b17e033a6c20773179e4c02d72599bf9b41cecee22b5fd96d87b2a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
-
|
|
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
|
-
|
|
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
|
|
@@ -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
|
|
@@ -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.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
|
+
date: 2020-01-12 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
13
|
description: Rails engine for events
|
|
14
14
|
email:
|