tramway-event 1.2.1 → 1.2.2

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: 3c6e619273da34ae3abd7762ca36c613a4cf69587731b3ca95067ac670e217a7
4
- data.tar.gz: e75b7c4c21f0ebb3d62ea3798a6239fa7b9b3a7b0492494862c9091d35ec9ac4
3
+ metadata.gz: 12871505e7bc517e14e48ef7699850fb07c79fa3286302bbb4c31e2fa822e3f8
4
+ data.tar.gz: 740e8dc55922dd36a39622fea9c4bd0586b93e7e1f2ca34e08ce085082caaac5
5
5
  SHA512:
6
- metadata.gz: 24dd4fafa80ff677f7fd7b152a4191864c699656502901f05f62c8e37d2d044f857090408c353b74f5ca5cf6feb122c182c14000295c7e3e909ab050796913b0
7
- data.tar.gz: 861c3aac242cfeb580deaac54f40c33f99de4ff8d490962d5abe876c453f2bb106129ef146ea3dfc15cbfb6a15ac51900077b7cd58442dd551cd1ab45fc619e6
6
+ metadata.gz: c4d9cb29b912cd9c6f15873658abcf7cd3b321b7570f4d59178aeb9e186d53c2753461833ad4a164fd27f5ef6d89cd9e4308ba17f811fe3dc30f7d3b62a15a70
7
+ data.tar.gz: bb23299cbd182e11e597258e72e7c3e72c004a24fae2ba0b9d2ea63475c215defcc25823f14924e0a7a4d11e49afa5238b02c63225c8068b70a291b1cdeea8ce
@@ -6,7 +6,7 @@ class Tramway::Event::EventsController < Tramway::Event::ApplicationController
6
6
  class_name = "ParticipantExtendedForm#{request.uuid.gsub('-', '')}"
7
7
  form_class = ::Tramway::Core::ExtendableForm.new(class_name, *@event.participant_form_fields.inputs_list.map(&:title).map(&:to_sym))
8
8
  @participant_form = form_class.new ::Tramway::Event::Participant.new
9
- @sections_as_features = @event.sections.map { |s| ::Tramway::Event::SectionFeatureDecorator.decorate s }
10
- @sections = @event.sections.map { |s| ::Tramway::Event::SectionDecorator.decorate s }
9
+ @sections_as_features = @event.sections.order(position: :asc).map { |s| ::Tramway::Event::SectionFeatureDecorator.decorate s }
10
+ @sections = @event.sections.order(position: :asc).map { |s| ::Tramway::Event::SectionDecorator.decorate s }
11
11
  end
12
12
  end
@@ -1,5 +1,5 @@
1
1
  class Tramway::Event::SectionForm < ::Tramway::Core::ApplicationForm
2
- properties :event, :title, :description, :photo, :icon
2
+ properties :event, :title, :description, :photo, :icon, :position
3
3
  association :event
4
4
 
5
5
  def initialize(object)
@@ -8,7 +8,8 @@ class Tramway::Event::SectionForm < ::Tramway::Core::ApplicationForm
8
8
  description: :ckeditor,
9
9
  event: :association,
10
10
  photo: :file,
11
- icon: :string
11
+ icon: :string,
12
+ position: :numeric
12
13
  end
13
14
  end
14
15
  end
@@ -32,7 +32,7 @@
32
32
  = render 'tramway/landing/blocks/templates/features_list', block: OpenStruct.new(title: "Направления IT Way'18", description: "Вы можете выбрать любое из направлений", anchor: :features), collection: @sections_as_features
33
33
  %hr
34
34
  = render 'tramway/event/participants/form'
35
- %hr
35
+ %br
36
36
  - @sections.each_with_index do |section, index|
37
37
  = render 'tramway/landing/blocks/templates/section_with_image_and_text', block: section
38
38
  - if index < @sections.count - 1
@@ -23,6 +23,7 @@ module Tramway::Event::Generators
23
23
  migration_template 'add_position_to_tramway_event_participant_form_fields.rb', 'db/migrate/add_position_to_tramway_event_participant_form_fields.rb'
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
+ migration_template 'add_position_to_tramway_event_sections.rb', 'db/migrate/add_position_to_tramway_event_sections.rb'
26
27
  end
27
28
  end
28
29
  end
@@ -0,0 +1,5 @@
1
+ class AddPositionToTramwayEventSections < ActiveRecord::Migration[5.1]
2
+ def change
3
+ add_column :tramway_event_sections, :position, :integer
4
+ end
5
+ end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Event
3
- VERSION = '1.2.1'
3
+ VERSION = '1.2.2'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tramway-event
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
@@ -60,6 +60,7 @@ files:
60
60
  - lib/tramway/event/generators/templates/add_options_to_tramway_event_participant_form_fields.rb
61
61
  - lib/tramway/event/generators/templates/add_photo_to_tramway_event_events.rb
62
62
  - lib/tramway/event/generators/templates/add_position_to_tramway_event_participant_form_fields.rb
63
+ - lib/tramway/event/generators/templates/add_position_to_tramway_event_sections.rb
63
64
  - lib/tramway/event/generators/templates/create_tramway_event_events.rb
64
65
  - lib/tramway/event/generators/templates/create_tramway_event_participant_form_fields.rb
65
66
  - lib/tramway/event/generators/templates/create_tramway_event_participants.rb