tramway-event 1.7.1 → 1.7.2

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: 2baba3b2752236d1721a925ac29886c65291b12736737997fb41748fe608f132
4
- data.tar.gz: 56339371cae2af091881ef8056775166e1dae674c7fb424fbf04aa626f45bf9f
3
+ metadata.gz: 7ad317f2b35cfd286c0e43bc653a6ed6e4f07140c39d8871eba4ab1662c4447c
4
+ data.tar.gz: 37afa824797847b110538d8b12c80750387dc1b5231592bc9d493229463ea6f0
5
5
  SHA512:
6
- metadata.gz: 84c472ec3441630feb76731fe181ff7b9691e40dfdb8fc400e4eba56e870334cf62ea10184797cd689c180d77e548b8a684f8ca9b17937ede93b8d97bdc0d4cb
7
- data.tar.gz: 1229f7a2f8de08bf85c51e7aed3b0cc30305ef1ae8bebd04251c765f3de84a7cce6c79dabe4b60127d770eca648ebf78d4a2143251c1782788d2fcac9922beeb
6
+ metadata.gz: bcd4d79d9b157d8652b8d812ead6d83c183fc50fcdf5b8b8983b7cd1e93312ae7d16129e8d3b50e532af6433b5257aca2cef28d4c0ccd66f74c636ccbbfdaed4
7
+ data.tar.gz: 38e30922400fab75fe018ce7335505fbcb7c7c9055d46496acec6c13342d7afc585c93d018f166620abbf9fd5f509f47e3e9bc69b1d855dd629a24761086e726
@@ -2,12 +2,12 @@ class Tramway::Event::EventsController < Tramway::Event::ApplicationController
2
2
  layout 'tramway/landing/application'
3
3
 
4
4
  def show
5
- @event = ::Tramway::Event::EventDecorator.decorate ::Tramway::Event::Event.find params[:id]
5
+ @event = ::Tramway::Event::Events::Show::EventDecorator.decorate ::Tramway::Event::Event.find params[:id]
6
6
  @participant_form = ::Tramway::Event::ParticipantExtendedFormCreator.create_form_class(request.uuid, @event).new ::Tramway::Event::Participant.new
7
7
  @sections_as_features = @event.sections.order(position: :asc).map { |s| ::Tramway::Event::SectionFeatureDecorator.decorate s }
8
8
  @sections = @event.sections.order(position: :asc).map { |s| ::Tramway::Event::SectionDecorator.decorate s }
9
9
  @footer = ::Tramway::Landing::BlockDecorator.decorate ::Tramway::Landing::Block.footer
10
- @events = ::Tramway::Event::Event.active.map { |e| ::Tramway::Event::EventDecorator.decorate e }
10
+ @events = ::Tramway::Event::Event.active.map { |e| ::Tramway::Event::Events::Show::EventDecorator.decorate e }
11
11
  @people_as_features = @event.partakings.active.map { |p| ::Tramway::Event::PartakingFeatureDecorator.decorate p }
12
12
  end
13
13
  end
@@ -7,10 +7,10 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
7
7
 
8
8
  delegate :title, to: :object
9
9
  delegate :description, to: :object
10
- delegate :participant_form_fields, to: :object
11
- delegate :sections, to: :object
12
- delegate :partakings, to: :object
13
10
  decorate_association :participants
11
+ decorate_association :participant_form_fields
12
+ decorate_association :sections
13
+ decorate_association :partakings
14
14
 
15
15
  def background
16
16
  object.photo
@@ -0,0 +1,29 @@
1
+ class Tramway::Event::Events::Show::EventDecorator < ::Tramway::Core::ApplicationDecorator
2
+ class << self
3
+ def collections
4
+ [ :all ]
5
+ end
6
+ end
7
+
8
+ delegate :title, to: :object
9
+ delegate :description, to: :object
10
+ delegate :participant_form_fields, to: :object
11
+ delegate :sections, to: :object
12
+ delegate :partakings, to: :object
13
+
14
+ def background
15
+ object.photo
16
+ end
17
+
18
+ def duration
19
+ if object.begin_date.to_date == object.end_date.to_date
20
+ "#{I18n.l(object.begin_date, format: '%d %B %Y')}"
21
+ elsif object.begin_date.month == object.end_date.month
22
+ "#{I18n.t('date.from')} #{I18n.l(object.begin_date, format: '%d')} #{I18n.t('date.to')} #{I18n.l(object.end_date, format: '%d %B %Y')}"
23
+ else
24
+ "#{I18n.t('date.from')} #{I18n.l(object.begin_date, format: '%d %B %Y')} #{I18n.t('date.to')} #{I18n.l(object.end_date, format: '%d %B %Y')}"
25
+ end
26
+ end
27
+
28
+ alias tagline duration
29
+ end
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Event
3
- VERSION = '1.7.1'
3
+ VERSION = '1.7.2'
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.7.1
4
+ version: 1.7.2
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-10-15 00:00:00.000000000 Z
11
+ date: 2018-10-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for events
14
14
  email:
@@ -29,6 +29,7 @@ files:
29
29
  - app/controllers/tramway/event/participants_controller.rb
30
30
  - app/decorators/tramway/event/event_decorator.rb
31
31
  - app/decorators/tramway/event/event_link_decorator.rb
32
+ - app/decorators/tramway/event/events/show/event_decorator.rb
32
33
  - app/decorators/tramway/event/partaking_decorator.rb
33
34
  - app/decorators/tramway/event/partaking_feature_decorator.rb
34
35
  - app/decorators/tramway/event/participant_decorator.rb