tramway-event 1.9.28.1 → 1.9.30

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: 55da21331575531d635e55fb6a79076a6522c88cca286b08db2996ab8bcc1cfc
4
- data.tar.gz: 90b93d96928a56c3d7fe0a82475b7168c2d995bd9d2358df102553e2794b7bf1
3
+ metadata.gz: ccbba9d4e213e01b03e1d8b447d3ecc7c999dc13e32b5902c76bc1a6422bba39
4
+ data.tar.gz: 1ac5580d257ffa32f36ca9bab2e28ac85fa9ae5a0c29bfaef4d8bc163b6a1ca2
5
5
  SHA512:
6
- metadata.gz: 2cb7761e9c4aabfafd54b191916cce6f0f90ca75577c38f922a41e382bef6143a26e33e28976cbd933a9b7820961138dacb43f090dbbde3a93440f783618024a
7
- data.tar.gz: 8ede73215d0a59bad13f5f25a9807c0a45f300638965c1d49ca77bfd1e24ef0e1ab37b91454beef8ef0efb78f38f66e8d590929f8521cfb0e8c14f64523ed620
6
+ metadata.gz: 73bd1a360e798f16ed21c4708fcb411b3a207a2e67fb220a0ec234ce7f317b8966f40ec2a12bbb5a3858f975f443217d2e80d867e2d2b6c835a54548c2d0f20a
7
+ data.tar.gz: 1d7e7c7a06dbd0fd4a0531d7eb959619591a6bd5213fa22a171eb922393cfa2e8aa34528b8a4882957ca89146edf66aa0ea70126b2646ba1a5032ea09a245a80
data/README.md CHANGED
@@ -12,6 +12,7 @@ How to use my plugin.
12
12
  gem 'tramway-event'
13
13
  gem 'carrierwave'
14
14
  gem 'more_html_tags'
15
+ gem 'configus'
15
16
  ```
16
17
 
17
18
  #### 2. And then execute:
@@ -48,6 +49,21 @@ Tramway::Admin.set_available_models ::Tramway::Event::Event, ::Tramway::Event::P
48
49
  mount Tramway::Event::Engine, at: '/'
49
50
  ```
50
51
 
52
+ #### 7. Add hosts in your environments via gem `configus`. [What is configus?](https://github.com/kaize/configus)
53
+
54
+ *config/configus.rb*
55
+ ```ruby
56
+ Configus.build Rails.env do
57
+ env :production do
58
+ host 'https://your-site-domain.com'
59
+ end
60
+ env :development do
61
+ host 'http://localhost:3000'
62
+ end
63
+ env :test, parent: :development
64
+ end
65
+ ```
66
+
51
67
  ## How-to
52
68
 
53
69
  ### Create event
@@ -75,7 +75,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
75
75
 
76
76
  def events_link
77
77
  event_link = Tramway::Event::Engine.routes.url_helpers.event_path object
78
- event_url = ['http://molodoy.online', event_link].join
78
+ event_url = [configus.host, event_link].join
79
79
  content_tag(:pre) do
80
80
  id = "event#{object.id}"
81
81
  concat link_to event_url, event_url, id: id
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::ParticipantXlsxDecorator < Tramway::Export::Xlsx::ApplicationDecorator
3
+ class Tramway::Event::ParticipantXlsDecorator < Tramway::Export::Xls::ApplicationDecorator
4
4
  class << self
5
5
  def columns
6
6
  %i[full_name email phone organization event].map do |attribute|
@@ -9,7 +9,7 @@ class Tramway::Event::ParticipantXlsxDecorator < Tramway::Export::Xlsx::Applicat
9
9
  end
10
10
 
11
11
  def filename
12
- 'participants.xlsx'
12
+ 'participants.xls'
13
13
  end
14
14
  end
15
15
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
4
4
  properties :title, :description, :begin_date, :end_date, :photo, :status,
5
5
  :request_collecting_begin_date, :request_collecting_end_date, :short_description
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::PartakingForm < ::Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::PartakingForm < ::Tramway::Core::ApplicationForm
4
4
  properties :part_id, :part_type, :person_id, :position
5
5
  associations :person, :part
6
6
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  require 'securerandom'
4
4
 
5
- class Tramway::Event::ParticipantForm < ::Tramway::Core::ApplicationForm
5
+ class Admin::Tramway::Event::ParticipantForm < ::Tramway::Core::ApplicationForm
6
6
  properties :participation_state_event, :comment
7
7
  association :event
8
8
 
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ExtendedApplicationForm
4
- properties :title, :description, :field_type, :options, :position, :list_field
3
+ class Admin::Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ExtendedApplicationForm
4
+ properties :title, :description, :field_type, :options, :position, :list_field, :presence_field
5
5
  association :event
6
6
 
7
7
  def initialize(object)
@@ -12,6 +12,7 @@ class Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ExtendedApplic
12
12
  field_type: :default,
13
13
  options: :text,
14
14
  list_field: :boolean,
15
+ presence_field: :boolean,
15
16
  position: :numeric
16
17
  end
17
18
  end
@@ -20,6 +21,7 @@ class Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ExtendedApplic
20
21
  super(params).tap do
21
22
  model.options = {} if model.options == ''
22
23
  model.options&.merge! list_field: (params[:list_field] == '1').to_s
24
+ model.options&.deep_merge! validations: { presence: (params[:presence_field] == '1').to_s }
23
25
  model.save
24
26
  end
25
27
  end
@@ -28,6 +30,10 @@ class Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ExtendedApplic
28
30
  model.options&.dig('list_field') == 'true'
29
31
  end
30
32
 
33
+ def presence_field
34
+ model.options&.dig('validations', 'presence') == 'true'
35
+ end
36
+
31
37
  def options
32
38
  model.options&.to_json
33
39
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::PersonForm < ::Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::PersonForm < ::Tramway::Core::ApplicationForm
4
4
  properties :first_name, :last_name, :photo, :description
5
5
 
6
6
  def initialize(object)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::PlaceForm < Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::PlaceForm < Tramway::Core::ApplicationForm
4
4
  properties :title, :description, :coordinates, :photo, :city
5
5
 
6
6
  def initialize(object)
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::SectionForm < ::Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::SectionForm < ::Tramway::Core::ApplicationForm
4
4
  properties :event, :title, :description, :photo, :icon, :position
5
5
  association :event
6
6
 
@@ -69,10 +69,17 @@ ru:
69
69
  options: Параметры (не редактировать без надобности)
70
70
  title: Название (в Tramway название Поля анкеты - это ключ для выборки пользователей. Если вы измените ключ к выборке пользователей, то все пользователи, получившие данные по предыдущему ключу по этой выборке показываться не будут)
71
71
  list_field: Показывать это поле в общем списке участников?
72
+ presence_field: Обязательное поле
72
73
  tramway/event/partaking:
73
74
  part_name: Мероприятие
74
75
  event_duration: Дата мероприятия
75
76
  part_description: Описание
77
+ errors:
78
+ models:
79
+ tramway/event/participant:
80
+ attributes:
81
+ default:
82
+ presence: не может быть пустым
76
83
  cases:
77
84
  tramway/event/event:
78
85
  plural: мероприятия
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.9.28.1'
5
+ VERSION = '1.9.30'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,15 +1,29 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.28.1
4
+ version: 1.9.30
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-02-07 00:00:00.000000000 Z
12
- dependencies: []
11
+ date: 2020-02-17 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: configus
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: Rails engine for events
14
28
  email:
15
29
  - kalashnikovisme@gmail.com
@@ -35,19 +49,19 @@ files:
35
49
  - app/decorators/tramway/event/partaking_feature_decorator.rb
36
50
  - app/decorators/tramway/event/participant_decorator.rb
37
51
  - app/decorators/tramway/event/participant_form_field_decorator.rb
38
- - app/decorators/tramway/event/participant_xlsx_decorator.rb
52
+ - app/decorators/tramway/event/participant_xls_decorator.rb
39
53
  - app/decorators/tramway/event/person_decorator.rb
40
54
  - app/decorators/tramway/event/place_decorator.rb
41
55
  - app/decorators/tramway/event/section_decorator.rb
42
56
  - app/decorators/tramway/event/section_feature_decorator.rb
43
- - app/forms/tramway/event/event_form.rb
44
- - app/forms/tramway/event/partaking_form.rb
57
+ - app/forms/admin/tramway/event/event_form.rb
58
+ - app/forms/admin/tramway/event/partaking_form.rb
59
+ - app/forms/admin/tramway/event/participant_form.rb
60
+ - app/forms/admin/tramway/event/participant_form_field_form.rb
61
+ - app/forms/admin/tramway/event/person_form.rb
62
+ - app/forms/admin/tramway/event/place_form.rb
63
+ - app/forms/admin/tramway/event/section_form.rb
45
64
  - app/forms/tramway/event/participant_extended_form_creator.rb
46
- - app/forms/tramway/event/participant_form.rb
47
- - app/forms/tramway/event/participant_form_field_form.rb
48
- - app/forms/tramway/event/person_form.rb
49
- - app/forms/tramway/event/place_form.rb
50
- - app/forms/tramway/event/section_form.rb
51
65
  - app/helpers/tramway/event/application_helper.rb
52
66
  - app/jobs/tramway/event/application_job.rb
53
67
  - app/mailers/tramway/event/application_mailer.rb