activeadmin-index_as_calendar 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/index_as_calendar/dsl.rb +6 -4
- data/lib/index_as_calendar/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 076e2a920999e7482aa390d4023121fec2ba0470
|
4
|
+
data.tar.gz: 3f0f7dff1921427379f74d1546d1703266647c73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0302ed4d4399cc0ee559f2505c1c516606c526e2cca8d425cbc0450127879b1c98ec174bfbc4409d302aaf964d915017cde13892ceded7d129f48f95fad3f37d
|
7
|
+
data.tar.gz: b3f20ab321ac7275e1562fd8893d2920a9c30e94157eefb8cecb4518aa7552167a9ab4a40a696025e26fdfded1ddac4984a9e98ca6c7648c4c5a0b9788122a99
|
@@ -12,7 +12,8 @@ module IndexAsCalendar
|
|
12
12
|
:start_date => :created_at, # Field to be used as start date for events
|
13
13
|
:end_date => nil, # Field to be used as end date for events
|
14
14
|
:block => block, # Block with the model<->event field mappings
|
15
|
-
:fullCalendarOptions => nil # fullCalendar options to be sent upon initialization
|
15
|
+
:fullCalendarOptions => nil, # fullCalendar options to be sent upon initialization
|
16
|
+
:default => false # Set this index view as default
|
16
17
|
}
|
17
18
|
options = default_options.deep_merge(options)
|
18
19
|
|
@@ -26,7 +27,8 @@ module IndexAsCalendar
|
|
26
27
|
{
|
27
28
|
:id => item.id,
|
28
29
|
:title => item.to_s,
|
29
|
-
:start => (options[:start_date].blank? or item.send(options[:start_date]).blank?) ? Date.today.to_s : item.send(options[:start_date])
|
30
|
+
:start => (options[:start_date].blank? or item.send(options[:start_date]).blank?) ? Date.today.to_s : item.send(options[:start_date]),
|
31
|
+
:end => (options[:end_date].blank? or item.send(options[:end_date]).blank?) ? nil : item.send(options[:end_date])
|
30
32
|
}
|
31
33
|
end
|
32
34
|
end
|
@@ -37,7 +39,7 @@ module IndexAsCalendar
|
|
37
39
|
if options[:ajax]
|
38
40
|
|
39
41
|
# Setup fullCalendar to use AJAX calls to retrieve event data
|
40
|
-
index as: :calendar do |context|
|
42
|
+
index as: :calendar, default: options[:default] do |context|
|
41
43
|
context[:fullCalendarOptions] = options[:fullCalendarOptions]
|
42
44
|
events = {
|
43
45
|
url: "#{collection_path()}/index_as_events.json",
|
@@ -62,7 +64,7 @@ module IndexAsCalendar
|
|
62
64
|
|
63
65
|
# Return events to be used during partial render
|
64
66
|
else
|
65
|
-
index as: :calendar do |context|
|
67
|
+
index as: :calendar, default: options[:default] do |context|
|
66
68
|
context[:fullCalendarOptions] = options[:fullCalendarOptions]
|
67
69
|
events = self.controller.event_mapping(context[:collection], options)
|
68
70
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activeadmin-index_as_calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- ByS Sistemas de Control
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-02-
|
11
|
+
date: 2016-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|