tramway-event 1.2.4 → 1.2.5

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: d33a97dbaf2f8666c15af834509f3b8fba3305236a906676c18f08efc8031cb8
4
- data.tar.gz: c3e946fa07d905b3dd61a58c16e0d54204220254bf7609b6bde60ae9287e97be
3
+ metadata.gz: d4aff151386753a77007f8d4842535580063e85f0a483a7b318985309f8c6687
4
+ data.tar.gz: ae73cae354765664407fd368d02a9c96f786e9a92e8eecf17cd567cd85987558
5
5
  SHA512:
6
- metadata.gz: f6460074710fa210db4cdffce7af9db83c944b91e6759b79906f42370ae40afbd5dab814eacffd5855f473cd4e6fab3281efbe59fde75fd8ac3102fcf86a79ce
7
- data.tar.gz: 8051fe570bc0b1b006c8f50b5328a427e8e9f9918eb011e056374a0bf34a6bdb3dc7e9d8bb99620fbf252700effba911a4cf2d2be9e864bf1dee67b68760d13d
6
+ metadata.gz: 0c4841bb00d0bfd7b8ae21cc20642647b2b3e8a27758f98ee55cc3cadb1554c2eb52a65633f443d6e1463446da05a9aee444fd2baba2c6dd55be528529cf67b5
7
+ data.tar.gz: 3830dbf28b9e6bb985d5c0fd162550a2d162ac1396738dd03db5a2c2cb3110bbc9820b449d57c8f606737045f3ec76d56a72a81cfe3a2a573a4d8df9f312af12
@@ -17,4 +17,10 @@ class Tramway::Event::EventDecorator < ::Tramway::Core::ApplicationDecorator
17
17
  def tagline
18
18
  ''
19
19
  end
20
+
21
+ 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)}"
24
+ end
25
+ end
20
26
  end
@@ -5,8 +5,8 @@ class Tramway::Event::EventForm < ::Tramway::Core::ApplicationForm
5
5
  form_object = super object
6
6
  form_properties title: :string,
7
7
  description: :ckeditor,
8
- begin_date: :default,
9
- end_date: :default,
8
+ begin_date: :date_picker,
9
+ end_date: :date_picker,
10
10
  photo: :file,
11
11
  status: :default
12
12
  form_object
@@ -1,18 +1,10 @@
1
- require "tramway/collection"
1
+ require "tramway/collections/helper"
2
2
 
3
3
  module Tramway
4
4
  module Event
5
5
  module ApplicationHelper
6
6
  include ::FontAwesome::Rails::IconHelper
7
- #extend ::Tramway::Collection::Helper
8
- def collection_list_by(name:)
9
- require name # needed to load class name with collection
10
- unless ::Tramway::Collection.descendants.map(&:to_s).include?(name.camelize)
11
- raise "There no such collection named #{name.camelize}. Please create class with self method `list` and extended of `Tramway::Collection`"
12
- end
13
-
14
- name.camelize.constantize.list
15
- end
7
+ include ::Tramway::Collections::Helper
16
8
  end
17
9
  end
18
10
  end
@@ -4,7 +4,7 @@
4
4
  %h1
5
5
  = t('.registration')
6
6
  - class_name = 'tramway_event_participant'
7
- = simple_form_for @participant_form, url: { controller: 'tramway/event/participants', action: :create }, html: { class: class_name, id: class_name } do |f|
7
+ = simple_form_for @participant_form, url: ::Tramway::Event::Engine.routes.url_helpers.participants_path, method: :post, html: { class: class_name, id: class_name } do |f|
8
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
9
  - event.participant_form_fields.inputs_list.each do |field|
10
10
  - case field.field_type
@@ -1,5 +1,5 @@
1
1
  module Tramway
2
2
  module Event
3
- VERSION = '1.2.4'
3
+ VERSION = '1.2.5'
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.4
4
+ version: 1.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pavel Kalashnikov