event_cal 1.2.3 → 1.2.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/event_cal/calendar_helper.rb +41 -37
- data/lib/event_cal/event.rb +2 -0
- data/lib/event_cal/version.rb +1 -1
- metadata +3 -3
@@ -1,46 +1,50 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
1
|
+
require 'event_cal'
|
2
|
+
|
3
|
+
module EventCal
|
4
|
+
module CalendarHelper
|
5
|
+
def wday_class_for(date)
|
6
|
+
case date.wday
|
7
|
+
when 0
|
8
|
+
'sunday'
|
9
|
+
when 6
|
10
|
+
'saturday'
|
11
|
+
end
|
8
12
|
end
|
9
|
-
end
|
10
13
|
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
14
|
+
def hightlight_classes(date, calendar)
|
15
|
+
classes = []
|
16
|
+
classes << 'today' if date == Date.today
|
17
|
+
events = calendar.events_on(date)
|
18
|
+
classes << 'has_events' if events.present?
|
19
|
+
events.map(&:class).uniq.each {|event_class| classes << event_class.to_s.underscore }
|
20
|
+
classes
|
21
|
+
end
|
19
22
|
|
20
|
-
|
21
|
-
|
23
|
+
def previous_month_path(calendar)
|
24
|
+
end
|
22
25
|
|
23
|
-
|
24
|
-
|
26
|
+
def next_month_path(calendar)
|
27
|
+
end
|
25
28
|
|
26
|
-
|
27
|
-
|
29
|
+
def today_path(calendar)
|
30
|
+
end
|
28
31
|
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
32
|
+
def render_monthly(calendar)
|
33
|
+
render(
|
34
|
+
{ :partial => 'event_cal/calendar',
|
35
|
+
:format => :html,
|
36
|
+
:locals => { :calendar => calendar },
|
37
|
+
}
|
38
|
+
)
|
39
|
+
end
|
37
40
|
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
def render_event_details(events)
|
42
|
+
render(
|
43
|
+
{ :partial => 'event_cal/event_details',
|
44
|
+
:format => :html,
|
45
|
+
:locals => { :events => events }
|
46
|
+
}
|
47
|
+
)
|
48
|
+
end
|
45
49
|
end
|
46
50
|
end
|
data/lib/event_cal/event.rb
CHANGED
data/lib/event_cal/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: event_cal
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -257,7 +257,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
257
257
|
version: '0'
|
258
258
|
segments:
|
259
259
|
- 0
|
260
|
-
hash:
|
260
|
+
hash: 4408682308685989950
|
261
261
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
262
262
|
none: false
|
263
263
|
requirements:
|
@@ -266,7 +266,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
266
266
|
version: '0'
|
267
267
|
segments:
|
268
268
|
- 0
|
269
|
-
hash:
|
269
|
+
hash: 4408682308685989950
|
270
270
|
requirements: []
|
271
271
|
rubyforge_project:
|
272
272
|
rubygems_version: 1.8.24
|