social_stream-events 0.3.2 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/stylesheets/events.css.scss +3 -0
- data/app/helpers/events_helper.rb +11 -1
- data/app/models/event.rb +12 -1
- data/lib/social_stream/events/models/actor.rb +6 -0
- data/lib/social_stream/events/version.rb +1 -1
- data/lib/social_stream/views/sidebar/events.rb +4 -2
- data/social_stream-events.gemspec +2 -2
- metadata +12 -12
@@ -1,5 +1,13 @@
|
|
1
1
|
module EventsHelper
|
2
2
|
def event_class(day)
|
3
|
+
begin_date = Time.now.beginning_of_week.to_date
|
4
|
+
end_date = begin_date + 28
|
5
|
+
|
6
|
+
busy_dates =
|
7
|
+
profile_or_current_subject.
|
8
|
+
events.
|
9
|
+
ocurrences(begin_date, end_date)
|
10
|
+
|
3
11
|
[].tap { |css|
|
4
12
|
css <<
|
5
13
|
if day < Date.today
|
@@ -10,7 +18,9 @@ module EventsHelper
|
|
10
18
|
"next_month"
|
11
19
|
end
|
12
20
|
|
13
|
-
|
21
|
+
|
22
|
+
css << "busy" if busy_dates.include?(day)
|
23
|
+
|
14
24
|
}.join(" ")
|
15
25
|
end
|
16
26
|
end
|
data/app/models/event.rb
CHANGED
@@ -9,12 +9,23 @@ class Event < ActiveRecord::Base
|
|
9
9
|
|
10
10
|
validate :room_belongs_to_receiver
|
11
11
|
|
12
|
+
class << self
|
13
|
+
def ocurrences(start_date, end_date)
|
14
|
+
between(start_date, end_date).
|
15
|
+
map { |e|
|
16
|
+
e.ocurrences(start_date, end_date)
|
17
|
+
}.
|
18
|
+
flatten.
|
19
|
+
uniq
|
20
|
+
end
|
21
|
+
end
|
22
|
+
|
12
23
|
def to_json(options = {})
|
13
24
|
if recurrence
|
14
25
|
st = options[:start].try(:to_date)
|
15
26
|
en = (options[:end] || end_at.end_of_month + 7.days).to_date
|
16
27
|
|
17
|
-
|
28
|
+
ocurrences(st, en).map do |d|
|
18
29
|
|
19
30
|
start_diff = d - start_at.to_date
|
20
31
|
end_diff = d - end_at.to_date
|
@@ -4,8 +4,10 @@ module SocialStream
|
|
4
4
|
module Events
|
5
5
|
def sidebar_items type
|
6
6
|
super.tap do |items|
|
7
|
-
|
8
|
-
|
7
|
+
if profile_or_current_subject
|
8
|
+
items.unshift :key => 'calendar',
|
9
|
+
:html => render(:partial => 'events/sidebar_calendar')
|
10
|
+
end
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
@@ -12,8 +12,8 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.files = `git ls-files`.split("\n")
|
13
13
|
|
14
14
|
# Gem dependencies
|
15
|
-
s.add_runtime_dependency('social_stream-base', '~> 0.
|
16
|
-
s.add_runtime_dependency('rails-scheduler', '~> 0.0.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.12.0')
|
16
|
+
s.add_runtime_dependency('rails-scheduler', '~> 0.0.5')
|
17
17
|
s.add_runtime_dependency('coffee-rails', '> 3.1.0')
|
18
18
|
|
19
19
|
# Development Gem dependencies
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: social_stream-events
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,33 +10,33 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2012-01-11 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: social_stream-base
|
17
|
-
requirement: &
|
17
|
+
requirement: &83181790 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ~>
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.
|
22
|
+
version: 0.12.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *83181790
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rails-scheduler
|
28
|
-
requirement: &
|
28
|
+
requirement: &83181320 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0.
|
33
|
+
version: 0.0.5
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *83181320
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: coffee-rails
|
39
|
-
requirement: &
|
39
|
+
requirement: &83164280 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>'
|
@@ -44,10 +44,10 @@ dependencies:
|
|
44
44
|
version: 3.1.0
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *83164280
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: sqlite3-ruby
|
50
|
-
requirement: &
|
50
|
+
requirement: &83163630 !ruby/object:Gem::Requirement
|
51
51
|
none: false
|
52
52
|
requirements:
|
53
53
|
- - ! '>='
|
@@ -55,7 +55,7 @@ dependencies:
|
|
55
55
|
version: '0'
|
56
56
|
type: :development
|
57
57
|
prerelease: false
|
58
|
-
version_requirements: *
|
58
|
+
version_requirements: *83163630
|
59
59
|
description: ! 'Social Stream is a Ruby on Rails engine providing your application
|
60
60
|
with social networking features and activity streams.
|
61
61
|
|