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 +4 -4
- data/app/decorators/tramway/event/event_decorator.rb +6 -0
- data/app/forms/tramway/event/event_form.rb +2 -2
- data/app/helpers/tramway/event/application_helper.rb +2 -10
- data/app/views/tramway/event/participants/_form.html.haml +1 -1
- data/lib/tramway/event/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4aff151386753a77007f8d4842535580063e85f0a483a7b318985309f8c6687
|
4
|
+
data.tar.gz: ae73cae354765664407fd368d02a9c96f786e9a92e8eecf17cd567cd85987558
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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: :
|
9
|
-
end_date: :
|
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/
|
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
|
-
|
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:
|
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
|