tramway-event 1.12.9.1 → 2.0

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.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/assets/javascripts/application.js +2 -2
  4. data/app/assets/javascripts/tramway/event/application.js +2 -2
  5. data/app/assets/stylesheets/tramway/event/events/show.css.sass +1 -1
  6. data/app/controllers/tramway/event/application_controller.rb +1 -1
  7. data/app/decorators/tramway/event/action_decorator.rb +1 -1
  8. data/app/decorators/tramway/event/event_decorator.rb +3 -6
  9. data/app/decorators/tramway/event/events/show/event_decorator.rb +3 -3
  10. data/app/decorators/tramway/event/partaking_decorator.rb +1 -1
  11. data/app/decorators/tramway/event/participant_decorator.rb +2 -6
  12. data/app/decorators/tramway/event/participant_form_field_decorator.rb +1 -1
  13. data/app/decorators/tramway/event/person_decorator.rb +1 -1
  14. data/app/decorators/tramway/event/place_decorator.rb +1 -1
  15. data/app/forms/admin/tramway/event/action_form.rb +1 -1
  16. data/app/forms/admin/tramway/event/event_form.rb +1 -1
  17. data/app/forms/admin/tramway/event/partaking_form.rb +1 -1
  18. data/app/forms/admin/tramway/event/participant_form.rb +1 -1
  19. data/app/forms/admin/tramway/event/participant_form_field_form.rb +1 -1
  20. data/app/forms/admin/tramway/event/person_form.rb +1 -1
  21. data/app/forms/admin/tramway/event/place_form.rb +1 -1
  22. data/app/forms/admin/tramway/event/section_form.rb +1 -1
  23. data/app/forms/tramway/event/participant_extended_form_creator.rb +3 -3
  24. data/app/models/tramway/event/action.rb +1 -1
  25. data/app/models/tramway/event/event.rb +6 -6
  26. data/app/models/tramway/event/partaking.rb +1 -1
  27. data/app/models/tramway/event/participant.rb +1 -1
  28. data/app/models/tramway/event/participant_form_field.rb +1 -1
  29. data/app/models/tramway/event/person.rb +1 -1
  30. data/app/models/tramway/event/place.rb +1 -1
  31. data/app/models/tramway/event/section.rb +1 -1
  32. data/app/views/tramway/event/participants/_form.html.haml +1 -1
  33. data/config/initializers/tramway.rb +2 -2
  34. data/lib/tramway/event/generators/install_generator.rb +2 -2
  35. data/lib/tramway/event/version.rb +1 -1
  36. metadata +4 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a03638173015428239ff38e7a724bf2ae2ba65aca674a2a08ec7f98059637102
4
- data.tar.gz: a2728d9c40e602b19889c2e0f5e7460b2cb75f5d6e7602759198898c3f7d8dee
3
+ metadata.gz: 015ee29d79339473ab21a7599accf8bc1b6069dc2857b2c27e2f043009ffe0d3
4
+ data.tar.gz: 14bc25abb9f1b8ad28c934950217fb9b11499f761fa6ea941e1bddc628015958
5
5
  SHA512:
6
- metadata.gz: 2242f1acfe0c9794b839b02c75a70ab14c51b78342457f7d552df554e9d2112c69b89df590b90cbb39f80c8046dcd3f099c7e048dd0a20ee521a528b3e00b328
7
- data.tar.gz: 417412652cbd4a05db2f934a297ebd271120245c596aeaab401559c1b797822f9b32d6248c1394141b2c22e9329a28160383cfc0ad7c98c34ec5734db5ec8f8f
6
+ metadata.gz: 6470ed1ac3acb351551206cef82ad9629f4216a679af39ee1c0a0ac423cc2dcb56d095702b56917aacc9a160a2669a60c95a6f996ef8aa561a8df21df021638c
7
+ data.tar.gz: 4511da3a712ebb85953d3c807c91bfead1bc81a3c9f046e462a8fe4814fe5b6a76206715e48f6483d6ca6ab713f159beb48abfb9f61600132bd55ec688109743
data/README.md CHANGED
@@ -39,7 +39,7 @@ Versions table
39
39
 
40
40
  *config/initializers/tramway.rb*
41
41
  ```ruby
42
- Tramway::Admin.set_available_models ::Tramway::Event::Event, ::Tramway::Event::ParticipantFormField, ::Tramway::Event::Participant, project: #{project_which_you_used_in_the_application}
42
+ Tramway.set_available_models ::Tramway::Event::Event, ::Tramway::Event::ParticipantFormField, ::Tramway::Event::Participant, project: #{project_which_you_used_in_the_application}
43
43
  ```
44
44
 
45
45
  #### 6. Add events routes to the app
@@ -1,8 +1,8 @@
1
- //= require tramway/core/application
1
+ //= require tramway/application
2
2
  //= require_tree .
3
3
  //= require clipboard
4
4
 
5
5
  $(document).ready(function(){
6
6
 
7
7
  var clipboard = new Clipboard('.clipboard-btn');
8
- });
8
+ });
@@ -1,2 +1,2 @@
1
- //= require tramway/core/application
2
- //= require_tree .
1
+ //= require tramway/application
2
+ //= require_tree .
@@ -1,5 +1,5 @@
1
1
  @import 'bootstrap'
2
- @import 'tramway/core/application'
2
+ @import 'tramway/application'
3
3
  @import 'tramway/landing/application'
4
4
  // @import 'tramway/conference/application'
5
5
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- class ApplicationController < ::Tramway::Core::ApplicationController
5
+ class ApplicationController < ActionController::Base
6
6
  protect_from_forgery with: :exception
7
7
  end
8
8
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::ActionDecorator < Tramway::Core::ApplicationDecorator
3
+ class Tramway::Event::ActionDecorator < Tramway::ApplicationDecorator
4
4
  class << self
5
5
  delegate :human_action_state_event_name, to: :model_class
6
6
  delegate :human_attribute_name, to: :model_class
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
3
+ class Tramway::Event::EventDecorator < ::Tramway::ApplicationDecorator
4
4
  class << self
5
5
  def collections
6
6
  [:all]
7
7
  end
8
8
 
9
9
  def show_attributes
10
- %i[title duration events_link state created_at photo request_collecting_duration description participants_list]
10
+ %i[title duration events_link created_at photo request_collecting_duration description participants_list]
11
11
  end
12
12
 
13
13
  def show_associations
@@ -43,7 +43,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
43
43
  end
44
44
 
45
45
  def participants_list
46
- content_tag :a, href: ::Tramway::Admin::Engine.routes.url_helpers.records_path(model: ::Tramway::Event::Participant, filter: { event_id_eq: object.id }) do
46
+ content_tag :a, href: ::Tramway::Engine.routes.url_helpers.records_path(model: ::Tramway::Event::Participant, filter: { event_id_eq: object.id }) do
47
47
  I18n.t('helpers.links.open')
48
48
  end
49
49
  end
@@ -92,8 +92,5 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
92
92
  end
93
93
  end
94
94
 
95
- def state
96
- state_machine_view object, :state
97
- end
98
95
  alias tagline duration
99
96
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Events::Show::EventDecorator < ::Tramway::Core::ApplicationDecorator
3
+ class Tramway::Event::Events::Show::EventDecorator < ::Tramway::ApplicationDecorator
4
4
  class << self
5
5
  def collections
6
6
  [:all]
@@ -45,10 +45,10 @@ class Tramway::Event::Events::Show::EventDecorator < ::Tramway::Core::Applicatio
45
45
 
46
46
  def responsible_person
47
47
  {
48
- title: Tramway::User::UserDecorator.decorate(object.creator)&.name,
48
+ title: Tramway::UserDecorator.decorate(object.creator)&.name,
49
49
  phone: (object.creator.phone if object.creator&.phone&.present?),
50
50
  email: (object.creator.email if object.creator&.email&.present?),
51
- social_networks: (object.creator.social_networks.active if object.creator.respond_to?(:social_networks))
51
+ social_networks: (object.creator.social_networks if object.creator.respond_to?(:social_networks))
52
52
  }
53
53
  end
54
54
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::PartakingDecorator < ::Tramway::Core::ApplicationDecorator
3
+ class Tramway::Event::PartakingDecorator < ::Tramway::ApplicationDecorator
4
4
  class << self
5
5
  def collections
6
6
  [:all]
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorator
3
+ class Tramway::Event::ParticipantDecorator < ::Tramway::ApplicationDecorator
4
4
  include HTMLTagsHelpers
5
5
  class << self
6
6
  def collections
@@ -13,7 +13,7 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
13
13
  delegate :human_participation_state_event_name, to: :model_class
14
14
 
15
15
  def show_attributes
16
- %i[id event values state created_at updated_at participation_state comment]
16
+ %i[id event values created_at updated_at participation_state comment]
17
17
  end
18
18
  end
19
19
 
@@ -96,10 +96,6 @@ class Tramway::Event::ParticipantDecorator < ::Tramway::Core::ApplicationDecorat
96
96
  end
97
97
  end
98
98
 
99
- def state
100
- state_machine_view object, :state
101
- end
102
-
103
99
  def created_at
104
100
  date_view object.created_at
105
101
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::ParticipantFormFieldDecorator < ::Tramway::Core::ApplicationDecorator
3
+ class Tramway::Event::ParticipantFormFieldDecorator < ::Tramway::ApplicationDecorator
4
4
  class << self
5
5
  def collections
6
6
  [:all]
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::PersonDecorator < ::Tramway::Core::ApplicationDecorator
3
+ class Tramway::Event::PersonDecorator < ::Tramway::ApplicationDecorator
4
4
  class << self
5
5
  def collections
6
6
  [:all]
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::PlaceDecorator < Tramway::Core::ApplicationDecorator
3
+ class Tramway::Event::PlaceDecorator < Tramway::ApplicationDecorator
4
4
  delegate :title, to: :object
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Admin::Tramway::Event::ActionForm < Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::ActionForm < Tramway::ApplicationForm
4
4
  properties :title, :action_state_event, :deadline
5
5
 
6
6
  association :event
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Admin::Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::EventForm < ::Tramway::ApplicationForm
4
4
  properties :title, :description, :begin_date, :end_date, :photo, :reach,
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 Admin::Tramway::Event::PartakingForm < ::Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::PartakingForm < ::Tramway::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 Admin::Tramway::Event::ParticipantForm < ::Tramway::Core::ApplicationForm
5
+ class Admin::Tramway::Event::ParticipantForm < ::Tramway::ApplicationForm
6
6
  properties :comment
7
7
  association :event
8
8
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Admin::Tramway::Event::ParticipantFormFieldForm < ::Tramway::Core::ExtendedApplicationForm
3
+ class Admin::Tramway::Event::ParticipantFormFieldForm < ::Tramway::ExtendedApplicationForm
4
4
  properties :title, :description, :field_type, :options, :position, :list_field, :presence_field, :select_options
5
5
  association :event
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Admin::Tramway::Event::PersonForm < ::Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::PersonForm < ::Tramway::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 Admin::Tramway::Event::PlaceForm < Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::PlaceForm < Tramway::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 Admin::Tramway::Event::SectionForm < ::Tramway::Core::ApplicationForm
3
+ class Admin::Tramway::Event::SectionForm < ::Tramway::ApplicationForm
4
4
  properties :event, :title, :description, :photo, :icon, :position
5
5
  association :event
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::ParticipantExtendedFormCreator < Tramway::Core::FormCreator
3
+ class Tramway::Event::ParticipantExtendedFormCreator < Tramway::FormCreator
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|
@@ -10,9 +10,9 @@ class Tramway::Event::ParticipantExtendedFormCreator < Tramway::Core::FormCreato
10
10
  }
11
11
  end
12
12
  if simple_properties.keys.any?
13
- ::Tramway::Core::ExtendableForm.new(class_name, simple_properties: simple_properties, **properties)
13
+ ::Tramway::ExtendableForm.new(class_name, simple_properties: simple_properties, **properties)
14
14
  else
15
- ::Tramway::Core::ExtendableForm.new(class_name, **properties)
15
+ ::Tramway::ExtendableForm.new(class_name, **properties)
16
16
  end
17
17
  end
18
18
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Action < Tramway::Core::ApplicationRecord
3
+ class Tramway::Event::Action < Tramway::ApplicationRecord
4
4
  belongs_to :event, class_name: 'Tramway::Event::Event'
5
5
 
6
6
  aasm :action_state, column: :action_state do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Event < ::Tramway::Core::ApplicationRecord
3
+ class Tramway::Event::Event < Tramway::ApplicationRecord
4
4
  mount_uploader :photo, PhotoUploader
5
5
 
6
6
  validate :check_dimensions
@@ -11,13 +11,13 @@ class Tramway::Event::Event < ::Tramway::Core::ApplicationRecord
11
11
  end
12
12
  end
13
13
 
14
- has_many :participants, class_name: 'Tramway::Event::Participant'
15
- has_many :participant_form_fields, -> { order(position: :asc) }, class_name: 'Tramway::Event::ParticipantFormField'
16
- has_many :sections, class_name: 'Tramway::Event::Section'
14
+ has_many :participants, class_name: 'Tramway::Event::Participant', dependent: :destroy
15
+ has_many :participant_form_fields, -> { order(position: :asc) }, class_name: 'Tramway::Event::ParticipantFormField', dependent: :destroy
16
+ has_many :sections, class_name: 'Tramway::Event::Section', dependent: :destroy
17
17
  has_many :partakings, as: :part, class_name: 'Tramway::Event::Partaking', dependent: :destroy
18
- has_many :partnerships, class_name: 'Tramway::Partner::Partnership', as: :partner
18
+ has_many :partnerships, class_name: 'Tramway::Partner::Partnership', as: :partner, dependent: :destroy
19
19
  has_many :organizations, as: :partners, through: :partnerships, class_name: 'Tramway::Partner::Organization'
20
- has_many :actions, -> { order(id: :asc) }, class_name: 'Tramway::Event::Action'
20
+ has_many :actions, -> { order(id: :asc) }, class_name: 'Tramway::Event::Action', dependent: :destroy
21
21
  has_and_belongs_to_many :places
22
22
 
23
23
  enumerize :reach, default: :open, in: %i[open closed]
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Partaking < ::Tramway::Core::ApplicationRecord
3
+ class Tramway::Event::Partaking < ::Tramway::ApplicationRecord
4
4
  belongs_to :part, polymorphic: true
5
5
  enumerize :part_type, in: ['Tramway::Event::Event', 'Tramway::Event::Section']
6
6
 
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Participant < ::Tramway::Core::ApplicationRecord
3
+ class Tramway::Event::Participant < ::Tramway::ApplicationRecord
4
4
  belongs_to :event, class_name: 'Tramway::Event::Event'
5
5
 
6
6
  aasm :participation_state, column: :participation_state do
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::ParticipantFormField < ::Tramway::Core::ApplicationRecord
3
+ class Tramway::Event::ParticipantFormField < ::Tramway::ApplicationRecord
4
4
  belongs_to :event, class_name: 'Tramway::Event::Event'
5
5
 
6
6
  enumerize :field_type, in: %i[text string numeric date_picker select checkbox], default: :text
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Person < ::Tramway::Core::ApplicationRecord
3
+ class Tramway::Event::Person < ::Tramway::ApplicationRecord
4
4
  has_many :partakings, class_name: 'Tramway::Event::Partaking'
5
5
 
6
6
  mount_uploader :photo, PhotoUploader
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Place < Tramway::Core::ApplicationRecord
3
+ class Tramway::Event::Place < Tramway::ApplicationRecord
4
4
  has_and_belongs_to_many :events
5
5
  end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- class Tramway::Event::Section < ::Tramway::Core::ApplicationRecord
3
+ class Tramway::Event::Section < ::Tramway::ApplicationRecord
4
4
  mount_uploader :photo, PhotoUploader
5
5
 
6
6
  belongs_to :event, class_name: 'Tramway::Event::Event'
@@ -8,5 +8,5 @@
8
8
  = simple_form_for @participant_form, url: ::Tramway::Event::Engine.routes.url_helpers.participants_path, method: :post, html: { class: class_name, id: class_name } do |f|
9
9
  = f.input :event_id, as: :hidden, input_html: { value: event.id, class: class_name, id: "#{class_name}_event_id", name: "#{class_name}[event_id]" }
10
10
  - event.participant_form_fields.inputs_list.each do |field|
11
- = render 'tramway/core/shared/input_extended', field: field, class_name: class_name, f: f, value: (params[:participant].present? ? params[:participant][field.title] : '')
11
+ = render 'tramway/shared/input_extended', field: field, class_name: class_name, f: f, value: (params[:participant].present? ? params[:participant][field.title] : '')
12
12
  = f.button :submit, t('.submit_form')
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- ::Tramway::Admin.set_available_models(::Tramway::Event::Event,
3
+ ::Tramway.set_available_models(::Tramway::Event::Event,
4
4
  ::Tramway::Event::ParticipantFormField,
5
5
  ::Tramway::Event::Participant,
6
6
  ::Tramway::Event::Section,
@@ -9,7 +9,7 @@
9
9
  ::Tramway::Event::Place,
10
10
  ::Tramway::Event::Action,
11
11
  project: :event)
12
- ::Tramway::Admin.set_notificable_queries new_participants: lambda { |current_user|
12
+ ::Tramway.set_notificable_queries new_participants: lambda { |current_user|
13
13
  ::Tramway::Event::Participant.where(participation_state: :requested).send "#{current_user.role}_scope", current_user.id
14
14
  }
15
15
 
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rails/generators'
4
- require 'tramway/core/generators/install_generator'
4
+ require 'tramway/generators/install_generator'
5
5
 
6
6
  module Tramway::Event::Generators
7
- class InstallGenerator < ::Tramway::Core::Generators::InstallGenerator
7
+ class InstallGenerator < ::Tramway::Generators::InstallGenerator
8
8
  include Rails::Generators::Migration
9
9
  source_root File.expand_path('templates', __dir__)
10
10
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.12.9.1'
5
+ VERSION = '2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.12.9.1
4
+ version: '2.0'
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-11-09 00:00:00.000000000 Z
11
+ date: 2023-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- name: configus
14
+ name: tramway
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
17
  - - ">="
@@ -116,7 +116,7 @@ files:
116
116
  - lib/tramway/event/generators/templates/remove_status_from_tramway_event_events.rb
117
117
  - lib/tramway/event/generators/templates/rename_tramway_event_people_sections_to_tramway_event_partakings.rb
118
118
  - lib/tramway/event/version.rb
119
- homepage: https://github.com/ulmic/tramway-event
119
+ homepage: https://github.com/kalashnikovisme/tramway-event
120
120
  licenses:
121
121
  - MIT
122
122
  metadata: {}