tramway-event 1.3 → 1.4

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: 561ce6e60c09b2065aa0054c1203e7f8faafb38308dbb1ec01e55bfebf606a18
4
- data.tar.gz: b2d52e2dac5e50dde7ed0099ad907c369d2ecc50ff6c087f1147cc6b587df220
3
+ metadata.gz: dcc54703252a31a5b2bc9195cbe54223b8ad244d28b7f33ae5fb46c220075fbb
4
+ data.tar.gz: 9bf2eca69564a9f8ce2879b151f8da58c5a90abda08f67b5324a1f12c5ec22c5
5
5
  SHA512:
6
- metadata.gz: 7237e9582084934e3f564719199efa0f9587a0f999623e2bcdb1158f23e5f3e614094025f007d5c41bd7f5b7551c40eb790c0ba33598cacf72a6ea07b8c63e45
7
- data.tar.gz: '09b550168725e0d6ee8e67a8e49fac7a5abedc621a605bc8a47a5b746c300cc53428d91491d1718f84666e163569d271731a23b00a86c234d4e6438ee841e1b6'
6
+ metadata.gz: ec11fd14671032bf0886beda4628ce47a33f29142435609efab56844bc349f1c7211a4974b079eba95e9f952f4d8d814525517f23caad25655b647324bf042b2
7
+ data.tar.gz: 1af2d5bfad864251ef6bbb9ec034d3cd92eacf4e9fe143e6df075067af41e2874c26580b6b11f9b2ea5084f3c72d2227e0829e2fc056532b9a6ada87ad86b633
@@ -1,6 +1,6 @@
1
1
  module Tramway
2
2
  module Event
3
- class ApplicationController < ActionController::Base
3
+ class ApplicationController < ::Tramway::Core::ApplicationController
4
4
  protect_from_forgery with: :exception
5
5
  end
6
6
  end
@@ -6,5 +6,7 @@ class Tramway::Event::EventsController < Tramway::Event::ApplicationController
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
+ @footer = ::Tramway::Landing::BlockDecorator.decorate ::Tramway::Landing::Block.footer
10
+ @events = ::Tramway::Event::Event.active.map { |e| ::Tramway::Event::EventDecorator.decorate e }
9
11
  end
10
12
  end
@@ -14,13 +14,15 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
14
14
  object.photo
15
15
  end
16
16
 
17
- def tagline
18
- ''
19
- end
20
-
21
17
  def duration
22
- if object.begin_date.present? && object.end_date.present?
23
- "#{I18n.t('date.from')} #{I18n.l(object.begin_date.to_date)} #{I18n.t('date.to')} #{I18n.l(object.end_date.to_date)}"
18
+ if object.begin_date.to_date == object.end_date.to_date
19
+ "#{I18n.l(object.begin_date, format: '%d %B %Y')}"
20
+ elsif object.begin_date.month == object.end_date.month
21
+ "#{I18n.t('date.from')} #{I18n.l(object.begin_date, format: '%d')} #{I18n.t('date.to')} #{I18n.l(object.end_date, format: '%d %B %Y')}"
22
+ else
23
+ "#{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')}"
24
24
  end
25
25
  end
26
+
27
+ alias tagline duration
26
28
  end
@@ -1,4 +1,10 @@
1
1
  - content_for :title do
2
2
  = @event.title
3
+ - content_for :footer_links do
4
+ %ul
5
+ - @events.each do |event|
6
+ %li
7
+ = link_to event.title, event_path(event)
3
8
  - content_for :body_content do
4
9
  = render 'tramway/event/events/show_page', event: @event, sections: @sections, sections_as_features: @sections_as_features
10
+ = render "tramway/landing/blocks/block_types/footer", block: @footer
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Event
3
- VERSION = '1.3'
3
+ VERSION = '1.4'
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.3'
4
+ version: '1.4'
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-25 00:00:00.000000000 Z
11
+ date: 2018-09-26 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Rails engine for events
14
14
  email: