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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: bc13197ef7e2cf3b121f2e51cae3d775d6c2ac86
4
- data.tar.gz: 02629fa0426731fecdb76530f27beb928d47695c
3
+ metadata.gz: 076e2a920999e7482aa390d4023121fec2ba0470
4
+ data.tar.gz: 3f0f7dff1921427379f74d1546d1703266647c73
5
5
  SHA512:
6
- metadata.gz: 244de5e5bf97165c3be31d8e9097f5b578fab134d625815e8272c22dabe931cf00bd66bbe85a867d7a2b24a7e094ca77b6a60a25be459f31316d4777f6ade710
7
- data.tar.gz: 34d97f5b3c40af04068d4af0dccde642361f92a402ae4a0683ee833adb0faed4819d9ed2b8f46ad4e23f0fa5b16f25a7e32430c8b4f31adc607ad5e866bdc696
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
@@ -1,3 +1,3 @@
1
1
  module IndexAsCalendar
2
- VERSION = "0.0.7"
2
+ VERSION = "0.0.8"
3
3
  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.7
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-10 00:00:00.000000000 Z
11
+ date: 2016-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails