tramway-event 1.12.0.1 → 1.12.1

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: 9d9f5ee0282d80240ee84fc78f7d3562dd96e5092638db8035fe02274215739a
4
- data.tar.gz: 6f9c93594ce896586adfceb26e3c46c77a0162667261ebadeca122f2e0da409f
3
+ metadata.gz: 544f404ca677177924dc37dbd8663450edf84809af2a9ff829506b59aa0b9c83
4
+ data.tar.gz: ec912ab9c38d1148f7714505effe8e89db678257e7fbb48c72f21e9235f362ec
5
5
  SHA512:
6
- metadata.gz: 01e5265ac663a60bed6a886109c04093acab7763c12f82777f6797c65d032506a7779f38162278514ecca9cebe52128c81f35704f58bcf9555b8cbffa9b0883d
7
- data.tar.gz: 2e92bca01081dd30f1bb25f9ddd1d132140818bfdcb2d3a0111881bdced91ece6d6ed2d5713da54e6734fd7e6885a207d7ce5ba69425a4736c124fd2bca2e38d
6
+ metadata.gz: d74327ad1079f66b9a8909610992efa1107006943839385c625545beb88d51dfff37160089832080f60f11d254341b2173afd163d597b86ba342707befefb78b
7
+ data.tar.gz: c3f7915b8c11b268201bab669c3442ac753c7abd5d6c2b49b7f41955e5bceb9ca34ad42089fc339809ac8c118e09af26fb0b0c14b3e06ec9139e0864d0310e60
@@ -7,17 +7,7 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
7
7
  end
8
8
 
9
9
  def show_attributes
10
- %i[
11
- title
12
- duration
13
- events_link
14
- state
15
- created_at
16
- photo
17
- request_collecting_duration
18
- description
19
- participants_list
20
- ]
10
+ %i[ title duration events_link state created_at photo request_collecting_duration description participants_list ]
21
11
  end
22
12
 
23
13
  def show_associations
@@ -103,6 +93,5 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
103
93
  def state
104
94
  state_machine_view object, :state
105
95
  end
106
-
107
96
  alias tagline duration
108
97
  end
@@ -50,4 +50,16 @@ class Tramway::Event::Events::Show::EventDecorator < ::Tramway::Core::Applicatio
50
50
  social_networks: (object.creator.social_networks.active if object.creator.respond_to?(:social_networks))
51
51
  }
52
52
  end
53
+
54
+ def is_past?
55
+ object.end_date < DateTime.now
56
+ end
57
+
58
+ def is_future?
59
+ object.begin_date > DateTime.now
60
+ end
61
+
62
+ def is_during?
63
+ object.begin_date < DateTime.now && object.end_date > DateTime.now
64
+ end
53
65
  end
@@ -12,7 +12,7 @@
12
12
  или пишите на email
13
13
  = mail_to @event.responsible_person[:email] || @application.email
14
14
 
15
- = render 'tramway/landing/blocks/templates/full_page', block: event, buttons: [OpenStruct.new(title: t('.registration'), anchor: '#registration')]
15
+ = render 'tramway/landing/templates/full_page', block: event, buttons: [(OpenStruct.new(title: t('.registration'), anchor: '#registration') if @event.request_collecting_state == :are_being_right_now)]
16
16
  - content_for :main_image do
17
17
  = request.protocol + request.host_with_port + event.background.url
18
18
  %main.event.show
@@ -20,19 +20,20 @@
20
20
  - if @event.responsible_person[:social_networks]&.any? || @event.responsible_person[:phone].present? || @event.responsible_person[:email].present?
21
21
  = render 'tramway/landing/blocks/block_types/contacts', block: OpenStruct.new(title: 'Контакты'), social_networks: @event.responsible_person[:social_networks], email: @event.responsible_person[:email], phone: @event.responsible_person[:phone]
22
22
  - if defined? sections_as_features
23
- = render 'tramway/landing/blocks/templates/features_list', collection: sections_as_features
23
+ = render 'tramway/landing/templates/features_list', collection: sections_as_features
24
24
  .row.description
25
25
  .col
26
26
  != event.description
27
- #registration
28
- = render 'tramway/event/participants/form', event: event
27
+ - unless @event.is_past?
28
+ #registration
29
+ = render 'tramway/event/participants/form', event: event
29
30
  - if defined? sections
30
31
  - sections.each_with_index do |section, index|
31
32
  = render 'tramway/event/sections/show_page', section: section
32
33
  - if index < sections.count - 1
33
34
  %br
34
35
  - if defined? people_as_features
35
- = render 'tramway/landing/blocks/templates/features_list', block: OpenStruct.new(title: "Оргкомитет", description: "", anchor: :organizers), collection: people_as_features, options: { image: { css: { class_name: 'circle' } } }
36
+ = render 'tramway/landing/templates/features_list', block: OpenStruct.new(title: "Оргкомитет", description: "", anchor: :organizers), collection: people_as_features, options: { image: { css: { class_name: 'circle' } } }
36
37
  - if defined? ::Tramway::Partner
37
38
  - ::Tramway::Partner::Partnership.partnership_type.values.each do |partnership_type|
38
- = render 'tramway/landing/blocks/templates/features_list', block: OpenStruct.new(title: t("enumerize.tramway/partner/partnership.partnership_type.#{partnership_type}")), collection: partners[partnership_type]
39
+ = render 'tramway/landing/templates/features_list', block: OpenStruct.new(title: t("enumerize.tramway/partner/partnership.partnership_type.#{partnership_type}")), collection: partners[partnership_type]
@@ -1,2 +1,2 @@
1
- = render 'tramway/landing/blocks/templates/section_with_image_and_text', block: section
2
- = render 'tramway/landing/blocks/templates/features_list', collection: section.partakings, options: { image: { css: { class_name: 'circle' } } }
1
+ = render 'tramway/landing/templates/section_with_image_and_text', block: section
2
+ = render 'tramway/landing/templates/features_list', collection: section.partakings, options: { image: { css: { class_name: 'circle' } } }
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Tramway
4
4
  module Event
5
- VERSION = '1.12.0.1'
5
+ VERSION = '1.12.1'
6
6
  end
7
7
  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.12.0.1
4
+ version: 1.12.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-24 00:00:00.000000000 Z
11
+ date: 2020-03-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: configus