tramway-event 1.9.25.1 → 1.9.27.3

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: 937ff3b06d9ea3497845040968ef84d1087ac7edef7564bdc6c6a7bbef421cd6
4
- data.tar.gz: e9c50108c1ce22dc8096e4d381a95765636e3d0de584ac2e2fcda6f811a9aacf
3
+ metadata.gz: 76552ff5dda59b163764bf4698e0c4c75b2693e3e60f2dbd7e533868e79585a3
4
+ data.tar.gz: fd33dcefca151bea4c14bab7b4e20190f9040dee74cefcb5a3da228cc3ebedab
5
5
  SHA512:
6
- metadata.gz: c0626430f816e7e5a4c43556b7f41645edbdab4c5492729ddda40531d3de2c4b30617bb4c496c504250da68177447c2605bed7045278e8667f31ed6beeaa2b90
7
- data.tar.gz: 48d9d68033b0306522cdeff49ef103d9dd8615ad8022f02413a283673cf56930d297c0278cc6c16d5307362f4b383168879857d9c7b292cd429bb2499af3e4b4
6
+ metadata.gz: a9cf10218564e0aa1c49fece8f4af25b7c08aa519fe8038bb724ace879ff133387a0376c039ece9500e395ddd0a0673786848615ca6fec6ffd38eafbd4ac023a
7
+ data.tar.gz: 6c29d51644ff6664e0eb276324e84b4ca890e7fcacf05917ecb16c2fd60ab81e0f37cd7b04896b682a83a8da54f42ee28c181770bc1bc5fff1e58464e25e2ee9
data/README.md CHANGED
@@ -27,6 +27,13 @@ rails db:migrate
27
27
 
28
28
  #### 4. Then make `tramway-landing` installation. [How-to](https://github.com/ulmic/tramway-dev/blob/develop/tramway-landing/README.md#installation)
29
29
 
30
+ Versions table
31
+
32
+ | tramway-event | tramway-landing |
33
+ | ------------- | --------------- |
34
+ | < 1.9.27.1 | 1.x |
35
+ | >= 1.9.27.2 | 2.x |
36
+
30
37
  #### 5. Add events to admin panel
31
38
 
32
39
  *config/initializers/tramway.rb*
@@ -41,6 +48,13 @@ Tramway::Admin.set_available_models ::Tramway::Event::Event, ::Tramway::Event::P
41
48
  mount Tramway::Event::Engine, at: '/'
42
49
  ```
43
50
 
51
+ ## How-to
52
+
53
+ ### Create event
54
+
55
+ English docs coming soon...
56
+ [На русском](https://github.com/ulmic/tramway-dev/tree/develop/tramway-event/docs/russian)
57
+
44
58
  ## Contributing
45
59
  Contribution directions go here.
46
60
 
@@ -0,0 +1,8 @@
1
+ //= require tramway/core/application
2
+ //= require_tree .
3
+ //= require clipboard
4
+
5
+ $(document).ready(function(){
6
+
7
+ var clipboard = new Clipboard('.clipboard-btn');
8
+ });
@@ -1,4 +1,2 @@
1
1
  //= require tramway/core/application
2
- //= require_tree .
3
-
4
- window.current_locale = window.i18n_locale('ru');
2
+ //= require_tree .
@@ -10,6 +10,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
10
10
  %i[
11
11
  title
12
12
  duration
13
+ events_link
13
14
  state
14
15
  created_at
15
16
  photo
@@ -24,7 +25,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
24
25
  end
25
26
 
26
27
  def list_attributes
27
- %i[requested_participants approved_participants]
28
+ %i[requested_participants approved_participants events_link]
28
29
  end
29
30
  end
30
31
 
@@ -71,6 +72,16 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
71
72
  end
72
73
  end
73
74
 
75
+ def events_link
76
+ event_link = Tramway::Event::Engine.routes.url_helpers.event_path object
77
+ event_url = ['http://molodoy.online', event_link].join
78
+ content_tag(:pre) do
79
+ id = "event#{object.id}"
80
+ concat link_to event_url, event_url, id: id
81
+ concat copy_to_clipboard id
82
+ end
83
+ end
84
+
74
85
  def request_collecting_duration
75
86
  return if object.request_collecting_begin_date.nil? || object.request_collecting_end_date.nil?
76
87
 
@@ -44,7 +44,7 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
44
44
  object.event.title
45
45
  end)
46
46
  end)
47
- object.event.participant_form_fields.map do |field|
47
+ object.event.participant_form_fields.active.map do |field|
48
48
  hash = if field.options.is_a?(Hash)
49
49
  field.options
50
50
  else
@@ -1,20 +1,33 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ApplicationForm
4
- properties :title, :description, :field_type, :options, :position
3
+ class Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ExtendedApplicationForm
4
+ properties :title, :description, :field_type, :options, :position, :list_field
5
5
  association :event
6
6
 
7
7
  def initialize(object)
8
8
  super(object).tap do
9
9
  form_properties event: :association,
10
- title: :string,
11
- description: :string,
12
- field_type: :default,
13
- options: :text,
14
- position: :numeric
10
+ title: :string,
11
+ description: :string,
12
+ field_type: :default,
13
+ options: :text,
14
+ list_field: :boolean,
15
+ position: :numeric
15
16
  end
16
17
  end
17
18
 
19
+ def submit(params)
20
+ super(params).tap do
21
+ model.options = {} if model.options == ''
22
+ model.options&.merge! list_field: (params[:list_field] == '1').to_s
23
+ model.save
24
+ end
25
+ end
26
+
27
+ def list_field
28
+ model.options&.dig('list_field') == 'true'
29
+ end
30
+
18
31
  def options
19
32
  model.options&.to_json
20
33
  end
@@ -1,7 +1,5 @@
1
1
  - content_for :title do
2
2
  = @event.title
3
- - content_for :head_content do
4
- = javascript_include_tag 'tramway/event/application'
5
3
  - content_for :footer_links do
6
4
  %ul
7
5
  - @events.each do |event|
@@ -8,6 +8,10 @@
8
8
  ::Tramway::Event::Partaking,
9
9
  ::Tramway::Event::Place,
10
10
  project: :event)
11
- ::Tramway::Admin.set_notificable_queries new_participants: -> (current_user) do
11
+ ::Tramway::Admin.set_notificable_queries new_participants: lambda { |current_user|
12
12
  ::Tramway::Event::Participant.active.where(participation_state: :requested).send "#{current_user.role}_scope", current_user.id
13
+ }
14
+
15
+ ::Tramway::Landing.head_content = lambda do
16
+ javascript_include_tag 'tramway/event/application'
13
17
  end
@@ -20,6 +20,7 @@ ru:
20
20
  tramway/event/place: Место
21
21
  attributes:
22
22
  tramway/event/event:
23
+ events_link: Ссылка на мероприятие
23
24
  title: Название
24
25
  name: Название
25
26
  description: Описание
@@ -49,6 +50,7 @@ ru:
49
50
  participation_state: Статус участника
50
51
  event: Мероприятие
51
52
  values: Данные
53
+ participation_state_event: Статус участия в мероприятии
52
54
  tramway/event/section:
53
55
  title: Название
54
56
  description: Описание
@@ -63,8 +65,9 @@ ru:
63
65
  description: Описание
64
66
  field_type: Тип поля
65
67
  position: Позиция в анкете
66
- options: Параметры
68
+ options: Параметры (не редактировать без надобности)
67
69
  title: Название (в Tramway название Поля анкеты - это ключ для выборки пользователей. Если вы измените ключ к выборке пользователей, то все пользователи, получившие данные по предыдущему ключу по этой выборке показываться не будут)
70
+ list_field: Показывать это поле в общем списке участников?
68
71
  tramway/event/partaking:
69
72
  part_name: Мероприятие
70
73
  event_duration: Дата мероприятия
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.9.25.1'
5
+ VERSION = '1.9.27.3'
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.25.1
4
+ version: 1.9.27.3
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-26 00:00:00.000000000 Z
11
+ date: 2020-01-29 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for events
14
14
  email:
@@ -21,6 +21,7 @@ files:
21
21
  - README.md
22
22
  - Rakefile
23
23
  - app/assets/config/tramway_event_manifest.js
24
+ - app/assets/javascripts/application.js
24
25
  - app/assets/javascripts/tramway/event/application.js
25
26
  - app/assets/stylesheets/tramway/event/application.css.sass
26
27
  - app/assets/stylesheets/tramway/event/events/show.css.sass