tramway-event 1.2.2 → 1.2.3

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 12871505e7bc517e14e48ef7699850fb07c79fa3286302bbb4c31e2fa822e3f8
4
- data.tar.gz: 740e8dc55922dd36a39622fea9c4bd0586b93e7e1f2ca34e08ce085082caaac5
3
+ metadata.gz: 40a19f3282b75310d92a2fc3bd21bdcb00c555c77fb8287795f3f67b80bd9b04
4
+ data.tar.gz: c70a3ada7e467bb2f4cd8e939208a56424ae4529534f924ce4700a5a09582697
5
5
  SHA512:
6
- metadata.gz: c4d9cb29b912cd9c6f15873658abcf7cd3b321b7570f4d59178aeb9e186d53c2753461833ad4a164fd27f5ef6d89cd9e4308ba17f811fe3dc30f7d3b62a15a70
7
- data.tar.gz: bb23299cbd182e11e597258e72e7c3e72c004a24fae2ba0b9d2ea63475c215defcc25823f14924e0a7a4d11e49afa5238b02c63225c8068b70a291b1cdeea8ce
6
+ metadata.gz: ca38e0fa4e489fe6a7c3d2d36cd25b3e44292ae2cced5ef320d39f83ab38adf006f87614949f0ee4d0e4f57aaa3f3d9b7a9a98a12b1520b1dea45b51705a587b
7
+ data.tar.gz: d2f940e9b5d3993c877583e04da177452b20cb736a3969714487ae87bd7251b2e9b36606ee8a366c13ffc9d8e11b3f7f357e9116186a72497dbb578ad54c9cab
@@ -3,9 +3,7 @@ class Tramway::Event::EventsController < Tramway::Event::ApplicationController
3
3
 
4
4
  def show
5
5
  @event = ::Tramway::Event::EventDecorator.decorate ::Tramway::Event::Event.find params[:id]
6
- class_name = "ParticipantExtendedForm#{request.uuid.gsub('-', '')}"
7
- form_class = ::Tramway::Core::ExtendableForm.new(class_name, *@event.participant_form_fields.inputs_list.map(&:title).map(&:to_sym))
8
- @participant_form = form_class.new ::Tramway::Event::Participant.new
6
+ @participant_form = ::Tramway::Event::ParticipantExtendedFormCreator.create_form_class(request.uuid, @event).new ::Tramway::Event::Participant.new
9
7
  @sections_as_features = @event.sections.order(position: :asc).map { |s| ::Tramway::Event::SectionFeatureDecorator.decorate s }
10
8
  @sections = @event.sections.order(position: :asc).map { |s| ::Tramway::Event::SectionDecorator.decorate s }
11
9
  end
@@ -6,6 +6,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
6
6
  end
7
7
 
8
8
  delegate :title, to: :object
9
+ delegate :description, to: :object
9
10
  delegate :participant_form_fields, to: :object
10
11
  delegate :sections, to: :object
11
12
 
@@ -1,5 +1,5 @@
1
1
  class Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
2
- properties :title, :description, :begin_date, :end_date, :photo
2
+ properties :title, :description, :begin_date, :end_date, :photo, :status
3
3
 
4
4
  def initialize(object)
5
5
  form_object = super object
@@ -7,7 +7,8 @@ class Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
7
7
  description: :ckeditor,
8
8
  begin_date: :default,
9
9
  end_date: :default,
10
- photo: :file
10
+ photo: :file,
11
+ status: :default
11
12
  form_object
12
13
  end
13
14
  end
@@ -0,0 +1,6 @@
1
+ class Tramway::Event::ParticipantExtendedFormCreator
2
+ def self.create_form_class(uuid, event)
3
+ class_name = "ParticipantExtendedForm#{uuid.gsub('-', '')}"
4
+ ::Tramway::Core::ExtendableForm.new(class_name, *event.participant_form_fields.inputs_list.map(&:title).map(&:to_sym))
5
+ end
6
+ end
@@ -4,7 +4,7 @@ module Tramway
4
4
  module Event
5
5
  module ApplicationHelper
6
6
  include ::FontAwesome::Rails::IconHelper
7
-
7
+ #extend ::Tramway::Collection::Helper
8
8
  def collection_list_by(name:)
9
9
  require name # needed to load class name with collection
10
10
  unless ::Tramway::Collection.descendants.map(&:to_s).include?(name.camelize)
@@ -4,4 +4,8 @@ class Tramway::Event::Event < ::Tramway::Event::ApplicationRecord
4
4
  has_many :participants, class_name: 'Tramway::Event::Participant'
5
5
  has_many :participant_form_fields, class_name: 'Tramway::Event::ParticipantFormField'
6
6
  has_many :sections, class_name: 'Tramway::Event::Section'
7
+
8
+ enumerize :status, default: :common, in: [ :common, :main ]
9
+
10
+ scope :main_event, -> { where(status: :main).last }
7
11
  end
@@ -0,0 +1,40 @@
1
+ = stylesheet_link_tag 'tramway/event/events/show'
2
+ - if params[:flash] == 'success'
3
+ .alert.alert-success{role: "alert"}
4
+ %button.close{"aria-label" => "Close", "data-dismiss" => "alert", type: "button"}
5
+ %span{"aria-hidden" => "true"} ×
6
+ %h4.alert-heading Заявка успешно отправлена!
7
+ %p Орг.комитет мероприятия свяжется с вами по одному из указанных вами каналов связи: телефон, email, страница ВКонтакте
8
+ %hr/
9
+ %p.mb-0
10
+ По всем вопросам обращайтесь по телефону
11
+ = tel_tag '+79278023244'
12
+ или пишите на email
13
+ = mail_to 'kalashnikov@ulmic.ru'
14
+ - if params[:flash] == 'error'
15
+ .alert.alert-danger{role: "alert"}
16
+ %button.close{"aria-label" => "Close", "data-dismiss" => "alert", type: "button"}
17
+ %span{"aria-hidden" => "true"} ×
18
+ %h4.alert-heading Ошибка при отправлении заявки!
19
+ %p Подробности ошибки описаны ниже в форме приёма заявок
20
+ %hr/
21
+ %p.mb-0
22
+ Если ошибка повторяется или не отображается, обращайтесь по телефону
23
+ = tel_tag '+79278023244'
24
+ или пишите на email
25
+ = mail_to 'kalashnikov@ulmic.ru'
26
+ - if request.path == ::Tramway::Event::Engine.routes.url_helpers.event_path(event.id)
27
+ = render 'tramway/landing/blocks/templates/full_page', block: event, buttons: []
28
+ %main
29
+ .container
30
+ = render 'tramway/landing/blocks/templates/features_list', block: OpenStruct.new(title: "Направления IT Way'18", description: "Вы можете выбрать любое из направлений", anchor: :features), collection: sections_as_features
31
+ %br
32
+ .row
33
+ != event.description
34
+ %hr
35
+ = render 'tramway/event/participants/form', event: event
36
+ %br
37
+ - sections.each_with_index do |section, index|
38
+ = render 'tramway/landing/blocks/templates/section_with_image_and_text', block: section
39
+ - if index < sections.count - 1
40
+ %br
@@ -1,39 +1,4 @@
1
1
  - content_for :title do
2
2
  = @event.title
3
3
  - content_for :body_content do
4
- = stylesheet_link_tag 'tramway/event/events/show'
5
- - if params[:flash] == 'success'
6
- .alert.alert-success{role: "alert"}
7
- %button.close{"aria-label" => "Close", "data-dismiss" => "alert", type: "button"}
8
- %span{"aria-hidden" => "true"} ×
9
- %h4.alert-heading Заявка успешно отправлена!
10
- %p Орг.комитет мероприятия свяжется с вами по одному из указанных вами каналов связи: телефон, email, страница ВКонтакте
11
- %hr/
12
- %p.mb-0
13
- По всем вопросам обращайтесь по телефону
14
- = tel_tag '+79278023244'
15
- или пишите на email
16
- = mail_to 'kalashnikov@ulmic.ru'
17
- - if params[:flash] == 'error'
18
- .alert.alert-danger{role: "alert"}
19
- %button.close{"aria-label" => "Close", "data-dismiss" => "alert", type: "button"}
20
- %span{"aria-hidden" => "true"} ×
21
- %h4.alert-heading Ошибка при отправлении заявки!
22
- %p Подробности ошибки описаны ниже в форме приёма заявок
23
- %hr/
24
- %p.mb-0
25
- Если ошибка повторяется или не отображается, обращайтесь по телефону
26
- = tel_tag '+79278023244'
27
- или пишите на email
28
- = mail_to 'kalashnikov@ulmic.ru'
29
- = render 'tramway/landing/blocks/templates/full_page', block: @event, buttons: []
30
- %main
31
- .container
32
- = render 'tramway/landing/blocks/templates/features_list', block: OpenStruct.new(title: "Направления IT Way'18", description: "Вы можете выбрать любое из направлений", anchor: :features), collection: @sections_as_features
33
- %hr
34
- = render 'tramway/event/participants/form'
35
- %br
36
- - @sections.each_with_index do |section, index|
37
- = render 'tramway/landing/blocks/templates/section_with_image_and_text', block: section
38
- - if index < @sections.count - 1
39
- %br
4
+ = render 'tramway/event/events/show_page', event: @event, sections: @sections, sections_as_features: @sections_as_features
@@ -1,12 +1,12 @@
1
- - if @event.participant_form_fields.any?
1
+ - if event.participant_form_fields.any?
2
2
  .row
3
3
  .col-lg-12
4
4
  %h1
5
5
  = t('.registration')
6
6
  - class_name = 'tramway_event_participant'
7
7
  = simple_form_for @participant_form, url: { controller: 'tramway/event/participants', action: :create }, html: { class: class_name, id: class_name } do |f|
8
- = f.input :event_id, as: :hidden, input_html: { value: @event.id, class: class_name, id: "#{class_name}_event_id", name: "#{class_name}[event_id]" }
9
- - @event.participant_form_fields.inputs_list.each do |field|
8
+ = f.input :event_id, as: :hidden, input_html: { value: event.id, class: class_name, id: "#{class_name}_event_id", name: "#{class_name}[event_id]" }
9
+ - event.participant_form_fields.inputs_list.each do |field|
10
10
  - case field.field_type
11
11
  - when 'text', 'string', 'numeric', 'date_picker'
12
12
  = f.input field.title.to_sym, as: field.field_type, input_html: { class: class_name, id: "#{class_name}_#{field.title}", name: "#{class_name}[#{field.title}]" }
@@ -24,6 +24,7 @@ module Tramway::Event::Generators
24
24
  migration_template 'create_tramway_event_sections.rb', 'db/migrate/create_tramway_event_sections.rb'
25
25
  migration_template 'add_icon_to_tramway_event_sections.rb', 'db/migrate/add_icon_to_tramway_event_sections.rb'
26
26
  migration_template 'add_position_to_tramway_event_sections.rb', 'db/migrate/add_position_to_tramway_event_sections.rb'
27
+ migration_template 'add_status_to_tramway_event_events.rb', 'db/migrate/add_status_to_tramway_event_events.rb'
27
28
  end
28
29
  end
29
30
  end
@@ -0,0 +1,5 @@
1
+ class AddStatusToTramwayEventEvents < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :tramway_event_events, :status, :text
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Event
3
- VERSION = '1.2.2'
3
+ VERSION = '1.2.3'
4
4
  end
5
5
  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.2.2
4
+ version: 1.2.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: 2018-09-23 00:00:00.000000000 Z
11
+ date: 2018-09-25 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for events
14
14
  email:
@@ -34,6 +34,7 @@ files:
34
34
  - app/decorators/tramway/event/section_decorator.rb
35
35
  - app/decorators/tramway/event/section_feature_decorator.rb
36
36
  - app/forms/tramway/event/event_form.rb
37
+ - app/forms/tramway/event/participant_extended_form_creator.rb
37
38
  - app/forms/tramway/event/participant_form.rb
38
39
  - app/forms/tramway/event/participant_form_field_form.rb
39
40
  - app/forms/tramway/event/section_form.rb
@@ -45,6 +46,7 @@ files:
45
46
  - app/models/tramway/event/participant.rb
46
47
  - app/models/tramway/event/participant_form_field.rb
47
48
  - app/models/tramway/event/section.rb
49
+ - app/views/tramway/event/events/_show_page.html.haml
48
50
  - app/views/tramway/event/events/show.html.haml
49
51
  - app/views/tramway/event/participants/_form.html.haml
50
52
  - config/initializers/assets.rb
@@ -61,6 +63,7 @@ files:
61
63
  - lib/tramway/event/generators/templates/add_photo_to_tramway_event_events.rb
62
64
  - lib/tramway/event/generators/templates/add_position_to_tramway_event_participant_form_fields.rb
63
65
  - lib/tramway/event/generators/templates/add_position_to_tramway_event_sections.rb
66
+ - lib/tramway/event/generators/templates/add_status_to_tramway_event_events.rb
64
67
  - lib/tramway/event/generators/templates/create_tramway_event_events.rb
65
68
  - lib/tramway/event/generators/templates/create_tramway_event_participant_form_fields.rb
66
69
  - lib/tramway/event/generators/templates/create_tramway_event_participants.rb