social_stream-events 0.8.2 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/images/poster.png +0 -0
- data/app/assets/javascripts/social_stream-events.js +7 -0
- data/app/assets/javascripts/social_stream.events.poster.js +21 -0
- data/app/assets/stylesheets/events.css.scss +25 -0
- data/app/helpers/events_helper.rb +9 -0
- data/app/models/activity_object_property/poster.rb +2 -0
- data/app/models/event.rb +18 -0
- data/app/views/events/_event.html.erb +39 -27
- data/app/views/events/_form_poster.html.erb +8 -0
- data/app/views/events/edit.js.erb +5 -0
- data/config/locales/en.yml +2 -0
- data/config/locales/es.yml +2 -0
- data/lib/social_stream-events.rb +2 -1
- data/lib/social_stream/events/engine.rb +6 -0
- data/lib/social_stream/events/models/document.rb +26 -0
- data/lib/social_stream/events/version.rb +1 -1
- data/social_stream-events.gemspec +1 -1
- metadata +18 -12
- data/app/assets/javascripts/0_init.js +0 -4
Binary file
|
@@ -0,0 +1,21 @@
|
|
1
|
+
SocialStream.Events.Poster = (function(SS, $, undefined){
|
2
|
+
var init = function(){
|
3
|
+
$('.event_poster_update').hide();
|
4
|
+
|
5
|
+
$('.event_poster').hover(
|
6
|
+
function(){
|
7
|
+
$(this).find(".event_poster_update").fadeIn("slow");
|
8
|
+
|
9
|
+
},
|
10
|
+
function(){
|
11
|
+
$(this).find(".event_poster_update").fadeOut("slow");
|
12
|
+
});
|
13
|
+
}
|
14
|
+
|
15
|
+
SS.Timeline.addInitCallback(init);
|
16
|
+
|
17
|
+
return {
|
18
|
+
init: init
|
19
|
+
};
|
20
|
+
|
21
|
+
})(SocialStream, jQuery);
|
@@ -15,6 +15,7 @@
|
|
15
15
|
text-align: center;
|
16
16
|
vertical-align: middle;
|
17
17
|
padding: 10px;
|
18
|
+
width: 40px;
|
18
19
|
}
|
19
20
|
|
20
21
|
|
@@ -48,6 +49,30 @@ div.event_date {
|
|
48
49
|
padding-top: 10px;
|
49
50
|
}
|
50
51
|
|
52
|
+
.event_poster {
|
53
|
+
width: 80px;
|
54
|
+
height: 113px;
|
55
|
+
margin-right: 10px;
|
56
|
+
float: left;
|
57
|
+
position: relative;
|
58
|
+
}
|
59
|
+
|
60
|
+
.event_poster_update {
|
61
|
+
top: 95px;
|
62
|
+
left: 10px;
|
63
|
+
float: left;
|
64
|
+
position: absolute;
|
65
|
+
background: $secondary-color;
|
66
|
+
text-align: center;
|
67
|
+
opacity: 0.8;
|
68
|
+
width: 80;
|
69
|
+
height: 18px;
|
70
|
+
/* For IE 5-7 */
|
71
|
+
filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=80);
|
72
|
+
/* For IE 8 */
|
73
|
+
-MS-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=80)";
|
74
|
+
}
|
75
|
+
|
51
76
|
#calendar {
|
52
77
|
margin-top: 20px;
|
53
78
|
}
|
data/app/models/event.rb
CHANGED
@@ -27,6 +27,18 @@ class Event < ActiveRecord::Base
|
|
27
27
|
end
|
28
28
|
end
|
29
29
|
|
30
|
+
def poster_object
|
31
|
+
object_properties.
|
32
|
+
where('activity_object_properties.type' => 'ActivityObjectProperty::Poster').
|
33
|
+
first
|
34
|
+
end
|
35
|
+
|
36
|
+
def poster
|
37
|
+
@poster ||=
|
38
|
+
poster_object.try(:document) ||
|
39
|
+
build_poster
|
40
|
+
end
|
41
|
+
|
30
42
|
protected
|
31
43
|
|
32
44
|
def build_json(start_time = start_at, end_time = end_at)
|
@@ -41,6 +53,12 @@ class Event < ActiveRecord::Base
|
|
41
53
|
|
42
54
|
end
|
43
55
|
|
56
|
+
def build_poster
|
57
|
+
Document.new(:event_property_object_id => activity_object_id,
|
58
|
+
:owner_id => owner_id)
|
59
|
+
end
|
60
|
+
|
61
|
+
|
44
62
|
private
|
45
63
|
|
46
64
|
def room_belongs_to_receiver
|
@@ -1,34 +1,46 @@
|
|
1
|
-
<%=
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
1
|
+
<%= div_for event do %>
|
2
|
+
<%= link_to event, :class => "event_date" do %>
|
3
|
+
<div class="event_date_image">
|
4
|
+
<div class="event_day">
|
5
|
+
<%= event.start_at.day %>
|
6
|
+
</div>
|
7
|
+
<div class="event_month">
|
8
|
+
<%= l event.start_at, :format => "%b" %>
|
9
|
+
</div>
|
10
|
+
<% unless event.all_day? %>
|
11
|
+
<div class="event_hour">
|
12
|
+
<%= l event.start_at, :format => "%H:%M" %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
12
15
|
</div>
|
13
16
|
<% end %>
|
14
|
-
</div>
|
15
|
-
<% end %>
|
16
17
|
|
17
|
-
<%= javascript_tag do %>
|
18
|
-
var d = new Date(<%= 1000*event.start_at.to_i %>);
|
19
|
-
$("
|
20
|
-
$("
|
21
|
-
if($("
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
}
|
26
|
-
<% end %>
|
18
|
+
<%= javascript_tag do %>
|
19
|
+
var d = new Date(<%= 1000*event.start_at.to_i %>);
|
20
|
+
$("#<%= dom_id event %> .event_day").text($.datepicker.formatDate('d', d));
|
21
|
+
$("#<%= dom_id event %> .event_month").text($.datepicker.formatDate('M', d));
|
22
|
+
if($("#<%= dom_id event %> .event_hour").length) {
|
23
|
+
var minutes = d.getMinutes();
|
24
|
+
if (minutes<10) minutes = "0" + minutes;
|
25
|
+
$("#<%= dom_id event %> .event_hour").text(d.getHours() + ':' + minutes);
|
26
|
+
}
|
27
|
+
<% end %>
|
27
28
|
|
28
|
-
<div class="
|
29
|
-
|
30
|
-
|
29
|
+
<div class="event_poster">
|
30
|
+
<%= event_timeline_thumb(event) %>
|
31
|
+
|
32
|
+
<% if can? :update, event %>
|
33
|
+
<div class="event_poster_update">
|
34
|
+
<%= link_to t('event.poster.update'), edit_event_path(event, :poster => true), :remote => true %>
|
35
|
+
</div>
|
36
|
+
<% end %>
|
31
37
|
</div>
|
32
|
-
|
38
|
+
|
39
|
+
<div class="event_details">
|
40
|
+
<div class="title">
|
41
|
+
<%= link_to event.title, event %>
|
42
|
+
</div>
|
43
|
+
</div>
|
44
|
+
<% end %>
|
33
45
|
|
34
46
|
<div class="clearfloat"></div>
|
@@ -0,0 +1,5 @@
|
|
1
|
+
<% if params[:poster] %>
|
2
|
+
$("#<%= dom_id @event %> .event_poster").hide("slow");
|
3
|
+
$("#<%= dom_id @event %> .event_details").hide("slow");
|
4
|
+
$("#<%= dom_id @event %>").append("<%= escape_javascript render(:partial => 'events/form_poster', :locals => { :event => @event }) %>");
|
5
|
+
<% end %>
|
data/config/locales/en.yml
CHANGED
data/config/locales/es.yml
CHANGED
data/lib/social_stream-events.rb
CHANGED
@@ -17,7 +17,8 @@ module SocialStream
|
|
17
17
|
autoload :Ability, 'social_stream/events/ability'
|
18
18
|
|
19
19
|
module Models
|
20
|
-
autoload :Actor,
|
20
|
+
autoload :Actor, 'social_stream/events/models/actor'
|
21
|
+
autoload :Document, 'social_stream/events/models/document'
|
21
22
|
end
|
22
23
|
|
23
24
|
SocialStream.objects.push(:event) unless SocialStream.objects.include?(:event)
|
@@ -13,6 +13,12 @@ module SocialStream
|
|
13
13
|
end
|
14
14
|
end
|
15
15
|
|
16
|
+
initializer "social_stream-events.document" do
|
17
|
+
ActiveSupport.on_load(:document) do
|
18
|
+
include SocialStream::Events::Models::Document
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
16
22
|
initializer "social_stream-events.views.settings" do
|
17
23
|
SocialStream::Views::Settings.module_eval do
|
18
24
|
include SocialStream::Views::Settings::Events
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module SocialStream
|
2
|
+
module Events
|
3
|
+
module Models
|
4
|
+
module Document
|
5
|
+
extend ActiveSupport::Concern
|
6
|
+
|
7
|
+
included do
|
8
|
+
attr_accessor :event_property_object_id
|
9
|
+
|
10
|
+
before_validation(:on => :create) do
|
11
|
+
set_event
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
protected
|
16
|
+
|
17
|
+
def set_event
|
18
|
+
return if event_property_object_id.blank?
|
19
|
+
|
20
|
+
activity_object_holders <<
|
21
|
+
ActivityObjectProperty::Poster.new(:activity_object_id => event_property_object_id)
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -12,7 +12,7 @@ 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.
|
15
|
+
s.add_runtime_dependency('social_stream-base', '~> 0.17.0')
|
16
16
|
s.add_runtime_dependency('rails-scheduler', '~> 0.0.6')
|
17
17
|
s.add_runtime_dependency('coffee-rails', '>= 3.1.0')
|
18
18
|
|
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.9.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,22 +10,22 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-07 00:00:00.000000000Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: social_stream-base
|
17
|
-
requirement: &
|
17
|
+
requirement: &87586580 !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.17.0
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *87586580
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rails-scheduler
|
28
|
-
requirement: &
|
28
|
+
requirement: &87586170 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ~>
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: 0.0.6
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *87586170
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: coffee-rails
|
39
|
-
requirement: &
|
39
|
+
requirement: &87585810 !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: *87585810
|
48
48
|
- !ruby/object:Gem::Dependency
|
49
49
|
name: sqlite3-ruby
|
50
|
-
requirement: &
|
50
|
+
requirement: &87585530 !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: *87585530
|
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
|
|
@@ -71,21 +71,26 @@ files:
|
|
71
71
|
- Gemfile
|
72
72
|
- README.rdoc
|
73
73
|
- Rakefile
|
74
|
-
- app/assets/
|
74
|
+
- app/assets/images/poster.png
|
75
75
|
- app/assets/javascripts/events.js.coffee
|
76
76
|
- app/assets/javascripts/social_stream-events.js
|
77
|
+
- app/assets/javascripts/social_stream.events.poster.js
|
77
78
|
- app/assets/stylesheets/events.css.scss
|
78
79
|
- app/assets/stylesheets/social_stream-events.css
|
79
80
|
- app/controllers/events_controller.rb
|
80
81
|
- app/controllers/rooms_controller.rb
|
82
|
+
- app/helpers/events_helper.rb
|
83
|
+
- app/models/activity_object_property/poster.rb
|
81
84
|
- app/models/event.rb
|
82
85
|
- app/models/room.rb
|
83
86
|
- app/views/events/_calendar_month.erb
|
84
87
|
- app/views/events/_event.html.erb
|
88
|
+
- app/views/events/_form_poster.html.erb
|
85
89
|
- app/views/events/_new.html.erb
|
86
90
|
- app/views/events/_sidebar_calendar.html.erb
|
87
91
|
- app/views/events/create.js.erb
|
88
92
|
- app/views/events/destroy.js.erb
|
93
|
+
- app/views/events/edit.js.erb
|
89
94
|
- app/views/events/index.html.erb
|
90
95
|
- app/views/rooms/_form.html.erb
|
91
96
|
- app/views/rooms/_index.html.erb
|
@@ -106,6 +111,7 @@ files:
|
|
106
111
|
- lib/social_stream/events/ability.rb
|
107
112
|
- lib/social_stream/events/engine.rb
|
108
113
|
- lib/social_stream/events/models/actor.rb
|
114
|
+
- lib/social_stream/events/models/document.rb
|
109
115
|
- lib/social_stream/events/version.rb
|
110
116
|
- lib/social_stream/migrations/events.rb
|
111
117
|
- lib/social_stream/toolbar_config/events.rb
|