social_stream 0.12.14 → 0.13.0
Sign up to get free protection for your applications and to get access to all the features.
- data/base/app/controllers/groups_controller.rb +3 -2
- data/base/app/controllers/posts_controller.rb +2 -10
- data/base/app/helpers/activities_helper.rb +2 -1
- data/base/app/models/activity_object.rb +28 -0
- data/base/app/models/actor.rb +10 -0
- data/base/app/models/group.rb +7 -3
- data/base/app/models/user.rb +7 -2
- data/base/app/views/activities/_new.html.erb +0 -1
- data/base/app/views/activity_objects/_activity_object.html.erb +3 -3
- data/base/app/views/comments/_new.html.erb +2 -3
- data/base/app/views/groups/_new.html.erb +0 -3
- data/base/app/views/notifications/activities/_like.text.erb +1 -1
- data/base/app/views/objects/_new_activity.html.erb +2 -2
- data/base/app/views/objects/_show.html.erb +1 -1
- data/base/db/migrate/20111124100618_object_actors.rb +50 -0
- data/base/lib/social_stream-base.rb +2 -1
- data/base/lib/social_stream/ability/base.rb +1 -1
- data/base/lib/social_stream/base/version.rb +1 -1
- data/base/lib/social_stream/controllers/objects.rb +33 -0
- data/base/lib/social_stream/models/object.rb +33 -28
- data/base/lib/social_stream/test_helpers/controllers.rb +3 -1
- data/base/lib/tasks/db/populate.rake +9 -2
- data/base/spec/controllers/comments_controller_spec.rb +9 -6
- data/base/spec/controllers/groups_controller_spec.rb +7 -5
- data/base/spec/controllers/posts_controller_spec.rb +45 -9
- data/base/spec/controllers/users_controller_spec.rb +3 -1
- data/base/spec/factories/activity.rb +3 -2
- data/base/spec/factories/comment.rb +3 -2
- data/base/spec/factories/group.rb +2 -1
- data/base/spec/factories/post.rb +5 -4
- data/base/spec/models/activity_authorization_spec.rb +5 -4
- data/base/spec/models/group_spec.rb +5 -2
- data/base/spec/models/post_spec.rb +6 -2
- data/documents/app/assets/stylesheets/show.css.scss +4 -0
- data/documents/app/controllers/documents_controller.rb +2 -10
- data/documents/app/views/audios/_audio_processed.html.erb +1 -1
- data/documents/app/views/audios/_audio_processing.html.erb +1 -1
- data/documents/app/views/common_documents/_document_info.html.erb +5 -0
- data/documents/app/views/documents/_document.html.erb +1 -1
- data/documents/app/views/pictures/_picture.html.erb +4 -4
- data/documents/app/views/videos/_video_processed.html.erb +1 -1
- data/documents/app/views/videos/_video_processing.html.erb +1 -1
- data/documents/lib/social_stream/documents/version.rb +1 -1
- data/documents/social_stream-documents.gemspec +1 -1
- data/documents/spec/factories/document.rb +7 -6
- data/documents/spec/factories/picture.rb +7 -6
- data/documents/spec/spec_helper.rb +6 -1
- data/events/db/migrate/20111102145626_add_more_fields_to_events.rb +0 -4
- data/events/db/migrate/20111104182420_add_details_to_events.rb +0 -26
- data/events/lib/social_stream/events/version.rb +1 -1
- data/events/social_stream-events.gemspec +1 -1
- data/lib/social_stream/version.rb +1 -1
- data/linkser/.gitignore +14 -0
- data/linkser/.rspec +1 -0
- data/linkser/Gemfile +5 -0
- data/linkser/MIT-LICENSE +20 -0
- data/linkser/README.rdoc +6 -0
- data/linkser/Rakefile +26 -0
- data/{documents/app/views/audios/_mediapreviews.html.erb → linkser/app/assets/javascripts/linkser.js.erb} +0 -0
- data/linkser/app/assets/javascripts/social_stream-linkser.js +1 -0
- data/linkser/app/assets/stylesheets/linkser.css.scss +1 -0
- data/linkser/app/assets/stylesheets/social_stream-linkser.css +3 -0
- data/linkser/config/locales/en.yml +3 -0
- data/linkser/config/locales/es.yml +3 -0
- data/linkser/config/routes.rb +3 -0
- data/linkser/lib/generators/social_stream/linkser/install_generator.rb +24 -0
- data/linkser/lib/social_stream-linkser.rb +9 -0
- data/linkser/lib/social_stream/linkser/engine.rb +7 -0
- data/linkser/lib/social_stream/linkser/version.rb +5 -0
- data/linkser/lib/social_stream/migrations/linkser.rb +9 -0
- data/linkser/social_stream-linkser.gemspec +26 -0
- data/linkser/spec/dummy/Rakefile +7 -0
- data/linkser/spec/dummy/app/controllers/application_controller.rb +3 -0
- data/linkser/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/linkser/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/linkser/spec/dummy/config.ru +4 -0
- data/linkser/spec/dummy/config/application.rb +45 -0
- data/linkser/spec/dummy/config/boot.rb +10 -0
- data/linkser/spec/dummy/config/database.yml +22 -0
- data/linkser/spec/dummy/config/environment.rb +5 -0
- data/linkser/spec/dummy/config/environments/development.rb +25 -0
- data/linkser/spec/dummy/config/environments/production.rb +49 -0
- data/linkser/spec/dummy/config/environments/test.rb +37 -0
- data/linkser/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/linkser/spec/dummy/config/initializers/devise.rb +176 -0
- data/linkser/spec/dummy/config/initializers/inflections.rb +10 -0
- data/linkser/spec/dummy/config/initializers/mime_types.rb +5 -0
- data/linkser/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/linkser/spec/dummy/config/initializers/session_store.rb +8 -0
- data/linkser/spec/dummy/config/locales/en.yml +5 -0
- data/linkser/spec/dummy/config/navigation.rb +0 -0
- data/linkser/spec/dummy/config/relations.yml +39 -0
- data/linkser/spec/dummy/config/routes.rb +60 -0
- data/linkser/spec/dummy/db/.gitkeep +0 -0
- data/linkser/spec/dummy/documents/documents/000/000/001/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/002/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/003/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/004/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/005/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/006/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/007/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/008/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/009/original.pdf +157 -0
- data/linkser/spec/dummy/documents/documents/000/000/010/original.pdf +157 -0
- data/linkser/spec/dummy/documents/pictures/000/000/011/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/011/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/011/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/012/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/012/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/012/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/013/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/013/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/013/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/014/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/014/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/014/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/015/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/015/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/015/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/016/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/016/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/016/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/017/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/017/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/017/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/018/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/018/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/018/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/019/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/019/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/019/thumb0.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/020/original.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/020/thumb.png +0 -0
- data/linkser/spec/dummy/documents/pictures/000/000/020/thumb0.png +0 -0
- data/linkser/spec/dummy/public/404.html +26 -0
- data/linkser/spec/dummy/public/422.html +26 -0
- data/linkser/spec/dummy/public/500.html +26 -0
- data/linkser/spec/dummy/public/favicon.ico +0 -0
- data/linkser/spec/dummy/public/javascripts/application.js +2 -0
- data/linkser/spec/dummy/public/javascripts/controls.js +965 -0
- data/linkser/spec/dummy/public/javascripts/dragdrop.js +974 -0
- data/linkser/spec/dummy/public/javascripts/effects.js +1123 -0
- data/linkser/spec/dummy/public/javascripts/prototype.js +6001 -0
- data/linkser/spec/dummy/public/javascripts/rails.js +191 -0
- data/linkser/spec/dummy/public/stylesheets/.gitkeep +0 -0
- data/linkser/spec/dummy/script/rails +6 -0
- data/linkser/spec/integration/navigation_spec.rb +9 -0
- data/linkser/spec/socialstream_linkser_spec.rb +7 -0
- data/linkser/spec/spec_helper.rb +48 -0
- data/linkser/spec/support/cancan.rb +1 -0
- data/linkser/spec/support/db.rb +8 -0
- data/linkser/spec/support/devise.rb +4 -0
- data/linkser/spec/support/mock.rb +4 -0
- data/linkser/vendor/assets/javascripts/jquery.jplayer.js +78 -0
- data/linkser/vendor/assets/stylesheets/jplayer.blue.monday.css +448 -0
- data/linkser/vendor/assets/stylesheets/jplayer.blue.monday.jpg +0 -0
- data/linkser/vendor/assets/stylesheets/jplayer.blue.monday.video.play.hover.png +0 -0
- data/linkser/vendor/assets/stylesheets/jplayer.blue.monday.video.play.png +0 -0
- data/linkser/vendor/assets/stylesheets/jquery.lightbox.css +101 -0
- data/linkser/vendor/assets/stylesheets/pbar-ani.gif +0 -0
- data/presence/app/assets/images/status/offline.png +0 -0
- data/presence/app/assets/javascripts/chat_interface_manager.js.erb +65 -16
- data/presence/app/assets/javascripts/xmpp_client_management.js.erb +13 -3
- data/presence/app/controllers/xmpp_controller.rb +2 -5
- data/presence/app/views/chat/_contacts.html.erb +10 -9
- data/presence/app/views/chat/_settings.html.erb +4 -4
- data/presence/app/views/xmpp/active_users.html.erb +10 -10
- data/presence/config/locales/en.yml +6 -1
- data/presence/config/locales/es.yml +7 -1
- data/presence/config/routes.rb +1 -4
- data/presence/lib/social_stream/presence/version.rb +1 -1
- data/social_stream.gemspec +3 -3
- metadata +127 -23
- data/documents/app/views/audios/index.js.erb +0 -1
- data/documents/app/views/documents/index.js.erb +0 -1
- data/documents/app/views/pictures/_mediapreviews.html.erb +0 -8
- data/documents/app/views/pictures/index.js.erb +0 -1
- data/presence/app/views/xmpp/index.html +0 -18
- data/presence/app/views/xmpp/test.html.erb +0 -11
@@ -14,9 +14,10 @@ describe CommentsController do
|
|
14
14
|
describe "comment from user" do
|
15
15
|
before do
|
16
16
|
activity = Factory(:self_activity, :contact => Factory(:self_contact, :sender => @user.actor))
|
17
|
-
contact = @user.contact_to!(@user)
|
18
17
|
|
19
|
-
model_attributes[:
|
18
|
+
model_attributes[:author_id] = @user.actor_id
|
19
|
+
model_attributes[:owner_id] = @user.actor_id
|
20
|
+
model_attributes[:user_author_id] = @user.actor_id
|
20
21
|
model_attributes[:_activity_parent_id] = activity.id
|
21
22
|
end
|
22
23
|
|
@@ -38,9 +39,10 @@ describe CommentsController do
|
|
38
39
|
before do
|
39
40
|
f = Factory(:friend, :contact => Factory(:contact, :receiver => @user.actor)).sender
|
40
41
|
activity = Factory(:self_activity, :contact => f.contact_to!(f))
|
41
|
-
contact = @user.contact_to!(f)
|
42
42
|
|
43
|
-
model_attributes[:
|
43
|
+
model_attributes[:author_id] = @user.actor_id
|
44
|
+
model_attributes[:owner_id] = f.id
|
45
|
+
model_attributes[:user_author_id] = @user.actor_id
|
44
46
|
model_attributes[:_activity_parent_id] = activity.id
|
45
47
|
end
|
46
48
|
|
@@ -51,9 +53,10 @@ describe CommentsController do
|
|
51
53
|
before do
|
52
54
|
a = Factory(:acquaintance, :contact => Factory(:contact, :receiver => @user.actor)).sender
|
53
55
|
activity = Factory(:self_activity, :contact => a.contact_to!(a))
|
54
|
-
contact = @user.contact_to!(a)
|
55
56
|
|
56
|
-
model_attributes[:
|
57
|
+
model_attributes[:author_id] = @user.actor_id
|
58
|
+
model_attributes[:owner_id] = a.id
|
59
|
+
model_attributes[:user_author_id] = @user.actor_id
|
57
60
|
model_attributes[:_activity_parent_id] = activity.id
|
58
61
|
end
|
59
62
|
|
@@ -26,9 +26,7 @@ describe GroupsController do
|
|
26
26
|
|
27
27
|
context "faking a new group" do
|
28
28
|
it "should deny creating" do
|
29
|
-
post :create, :group => { :name => "Test"
|
30
|
-
:_contact_id => Factory(:user).ego_contact.id
|
31
|
-
}
|
29
|
+
post :create, :group => { :name => "Test" }
|
32
30
|
|
33
31
|
response.should redirect_to(new_user_session_path)
|
34
32
|
end
|
@@ -79,7 +77,8 @@ describe GroupsController do
|
|
79
77
|
|
80
78
|
context "a new own group" do
|
81
79
|
before do
|
82
|
-
model_attributes[:
|
80
|
+
model_attributes[:author_id] = @user.actor_id
|
81
|
+
model_attributes[:user_author_id] = @user.actor_id
|
83
82
|
end
|
84
83
|
|
85
84
|
it "should allow creating" do
|
@@ -125,7 +124,10 @@ describe GroupsController do
|
|
125
124
|
|
126
125
|
context "a new fake group" do
|
127
126
|
before do
|
128
|
-
|
127
|
+
user = Factory(:user)
|
128
|
+
|
129
|
+
model_attributes[:author_id] = user.actor_id
|
130
|
+
model_attributes[:user_author_id] = user.actor_id
|
129
131
|
end
|
130
132
|
|
131
133
|
it_should_behave_like "Deny Creating"
|
@@ -1,6 +1,5 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
|
4
3
|
describe PostsController do
|
5
4
|
include SocialStream::TestHelpers
|
6
5
|
include SocialStream::TestHelpers::Controllers
|
@@ -19,7 +18,10 @@ describe PostsController do
|
|
19
18
|
contact = @user.contact_to!(@user)
|
20
19
|
relation = @user.relation_customs.sort.first
|
21
20
|
model_assigned_to @user.contact_to!(@user), relation
|
22
|
-
@current_model = Factory(:post, :
|
21
|
+
@current_model = Factory(:post, :author_id => @user.actor_id,
|
22
|
+
:owner_id => @user.actor_id,
|
23
|
+
:user_author_id => @user.actor_id,
|
24
|
+
:_relation_ids => Array(relation.id))
|
23
25
|
end
|
24
26
|
|
25
27
|
it_should_behave_like "Allow Creating"
|
@@ -31,7 +33,10 @@ describe PostsController do
|
|
31
33
|
contact = @user.contact_to!(@user)
|
32
34
|
relation = @user.relation_customs.sort.last
|
33
35
|
model_assigned_to @user.contact_to!(@user), relation
|
34
|
-
@current_model = Factory(:post, :
|
36
|
+
@current_model = Factory(:post, :author_id => @user.actor_id,
|
37
|
+
:owner_id => @user.actor_id,
|
38
|
+
:user_author_id => @user.actor_id,
|
39
|
+
:_relation_ids => Array(relation.id))
|
35
40
|
end
|
36
41
|
|
37
42
|
it_should_behave_like "Allow Creating"
|
@@ -43,7 +48,9 @@ describe PostsController do
|
|
43
48
|
contact = @user.contact_to!(@user)
|
44
49
|
relation = @user.relation_public
|
45
50
|
model_assigned_to @user.contact_to!(@user), relation
|
46
|
-
@current_model = Factory(:post, :
|
51
|
+
@current_model = Factory(:post, :author_id => @user.actor_id,
|
52
|
+
:owner_id => @user.actor_id,
|
53
|
+
:user_author_id => @user.actor_id)
|
47
54
|
end
|
48
55
|
|
49
56
|
it_should_behave_like "Allow Creating"
|
@@ -82,7 +89,10 @@ describe PostsController do
|
|
82
89
|
relation = @group.relation_custom('member')
|
83
90
|
|
84
91
|
model_assigned_to contact, relation
|
85
|
-
@current_model = Factory(:post, :
|
92
|
+
@current_model = Factory(:post, :author_id => contact.sender.id,
|
93
|
+
:owner_id => contact.receiver.id,
|
94
|
+
:user_author_id => contact.sender.id,
|
95
|
+
:_relation_ids => Array(relation.id))
|
86
96
|
end
|
87
97
|
|
88
98
|
it_should_behave_like "Allow Creating"
|
@@ -99,7 +109,10 @@ describe PostsController do
|
|
99
109
|
contact = @group.contact_to!(@group)
|
100
110
|
relation = @group.relation_customs.sort.first
|
101
111
|
model_assigned_to contact, relation
|
102
|
-
@current_model = Factory(:post, :
|
112
|
+
@current_model = Factory(:post, :author_id => contact.sender.id,
|
113
|
+
:owner_id => contact.receiver.id,
|
114
|
+
:user_author_id => contact.sender.id,
|
115
|
+
:_relation_ids => Array(relation.id))
|
103
116
|
end
|
104
117
|
|
105
118
|
it_should_behave_like "Allow Creating"
|
@@ -111,7 +124,10 @@ describe PostsController do
|
|
111
124
|
contact = @group.contact_to!(@group)
|
112
125
|
relation = @group.relation_customs.sort.last
|
113
126
|
model_assigned_to contact, relation
|
114
|
-
@current_model = Factory(:post, :
|
127
|
+
@current_model = Factory(:post, :author_id => contact.sender.id,
|
128
|
+
:owner_id => contact.receiver.id,
|
129
|
+
:user_author_id => contact.sender.id,
|
130
|
+
:_relation_ids => Array(relation.id))
|
115
131
|
end
|
116
132
|
|
117
133
|
it_should_behave_like "Allow Creating"
|
@@ -123,7 +139,10 @@ describe PostsController do
|
|
123
139
|
contact = @group.contact_to!(@group)
|
124
140
|
relation = @group.relation_public
|
125
141
|
model_assigned_to contact, relation
|
126
|
-
@current_model = Factory(:post,
|
142
|
+
@current_model = Factory(:post, :author_id => contact.sender.id,
|
143
|
+
:owner_id => contact.receiver.id,
|
144
|
+
:user_author_id => contact.sender.id,
|
145
|
+
:_relation_ids => Array(relation.id))
|
127
146
|
end
|
128
147
|
|
129
148
|
it_should_behave_like "Allow Creating"
|
@@ -143,7 +162,7 @@ describe PostsController do
|
|
143
162
|
sign_in @tie.receiver_subject
|
144
163
|
|
145
164
|
post :create, :post => { :text => "Test",
|
146
|
-
:
|
165
|
+
:owner_id => @tie.contact.sender.id
|
147
166
|
}
|
148
167
|
|
149
168
|
post = assigns(:post)
|
@@ -151,6 +170,23 @@ describe PostsController do
|
|
151
170
|
post.should be_valid
|
152
171
|
post.post_activity.relations.should include(@tie.relation)
|
153
172
|
end
|
173
|
+
|
174
|
+
it "should assign activity to member" do
|
175
|
+
sign_in @tie.receiver_subject
|
176
|
+
|
177
|
+
post :create, :post => { :text => "Test",
|
178
|
+
:owner_id => @tie.contact.sender.id
|
179
|
+
},
|
180
|
+
:format => :js
|
181
|
+
|
182
|
+
|
183
|
+
post = assigns(:post)
|
184
|
+
|
185
|
+
post.should be_valid
|
186
|
+
post.post_activity.relations.should include(@tie.relation)
|
187
|
+
|
188
|
+
response.should be_success
|
189
|
+
end
|
154
190
|
end
|
155
191
|
|
156
192
|
context "creating public post" do
|
@@ -74,7 +74,9 @@ describe UsersController do
|
|
74
74
|
it "should render other's page with activity" do
|
75
75
|
tie = Factory(:friend, :receiver => @user.actor)
|
76
76
|
friend = tie.sender
|
77
|
-
Factory(:post, :
|
77
|
+
Factory(:post, :author_id => tie.sender.id,
|
78
|
+
:owner_id => tie.receiver.id,
|
79
|
+
:user_author_id => tie.sender.id,
|
78
80
|
:_relation_ids => Array(tie.relation_id))
|
79
81
|
|
80
82
|
get :show, :id => friend.to_param
|
@@ -38,11 +38,12 @@ Factory.define :public_activity, :parent => :activity do |a|
|
|
38
38
|
a.relation_ids { |b| Array(b.sender.relation_public.id) }
|
39
39
|
end
|
40
40
|
|
41
|
-
Factory.define :like_activity, :
|
41
|
+
Factory.define :like_activity, :class => 'Activity' do |a|
|
42
42
|
a.association :parent, :factory => :activity
|
43
43
|
a.contact { |b| Factory(:friend, :sender => b.parent.sender).receiver.contact_to!(b.parent.sender) }
|
44
44
|
a.activity_verb { ActivityVerb["like"] }
|
45
|
-
a.relation_ids
|
45
|
+
a.relation_ids { |b| b.parent.relation_ids }
|
46
|
+
a.after_build{ |b| b.activity_object_ids = b.parent.activity_object_ids }
|
46
47
|
end
|
47
48
|
|
48
49
|
|
@@ -1,5 +1,6 @@
|
|
1
1
|
Factory.define :comment do |p|
|
2
2
|
p.sequence(:text) { |n| "Comment #{ n }" }
|
3
|
-
p.
|
4
|
-
p.
|
3
|
+
p.author_id { Factory(:friend).receiver.id }
|
4
|
+
p.owner_id { |q| Actor.find(q.author_id).received_ties.first.sender.id }
|
5
|
+
p.user_author_id { |q| q.author_id }
|
5
6
|
end
|
data/base/spec/factories/post.rb
CHANGED
@@ -1,10 +1,11 @@
|
|
1
1
|
Factory.define :post do |p|
|
2
2
|
p.sequence(:text) { |n| "Post #{ n }" }
|
3
|
-
p.
|
4
|
-
p.
|
3
|
+
p.author_id { Factory(:friend).receiver.id }
|
4
|
+
p.owner_id { |q| Actor.find(q.author_id).received_ties.first.sender.id }
|
5
|
+
p.user_author_id { |q| q.author_id }
|
5
6
|
end
|
6
7
|
|
7
8
|
Factory.define :public_post, :parent => :post do |p|
|
8
|
-
p.
|
9
|
-
p._relation_ids { |q| Array(
|
9
|
+
p.owner_id { |q| q.author_id }
|
10
|
+
p._relation_ids { |q| Array(q.author.relation_public.id) }
|
10
11
|
end
|
@@ -2,10 +2,11 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
module ActivityTestHelper
|
4
4
|
def create_activity(contact, relations)
|
5
|
-
@activity = Factory(:
|
6
|
-
:
|
7
|
-
:
|
8
|
-
|
5
|
+
@activity = Factory(:post,
|
6
|
+
:author_id => contact.sender.id,
|
7
|
+
:owner_id => contact.receiver.id,
|
8
|
+
:user_author_id => contact.sender.id,
|
9
|
+
:_relation_ids => Array(Relation.normalize_id(relations))).post_activity
|
9
10
|
end
|
10
11
|
|
11
12
|
def create_ability_accessed_by(subject)
|
@@ -2,9 +2,12 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe Group do
|
4
4
|
it "should save description" do
|
5
|
-
|
5
|
+
user = Factory(:user)
|
6
|
+
|
7
|
+
g = Group.create :name => "Test",
|
6
8
|
:description => "Testing description",
|
7
|
-
:
|
9
|
+
:author_id => user.actor.id,
|
10
|
+
:user_author_id => user.actor.id
|
8
11
|
|
9
12
|
g.reload.description.should be_present
|
10
13
|
end
|
@@ -36,7 +36,9 @@ describe Post do
|
|
36
36
|
tie = Factory(:friend)
|
37
37
|
|
38
38
|
post = Post.new :text => "testing",
|
39
|
-
:
|
39
|
+
:author_id => tie.receiver.id,
|
40
|
+
:owner_id => tie.sender.id,
|
41
|
+
:user_author_id => tie.receiver.id
|
40
42
|
|
41
43
|
assert post.build_post_activity.allow? tie.receiver_subject, 'create'
|
42
44
|
|
@@ -49,7 +51,9 @@ describe Post do
|
|
49
51
|
tie = Factory(:friend)
|
50
52
|
|
51
53
|
post = Post.new :text => "testing",
|
52
|
-
:
|
54
|
+
:author_id => tie.receiver.id,
|
55
|
+
:owner_id => tie.sender.id,
|
56
|
+
:user_author_id => tie.receiver.id
|
53
57
|
|
54
58
|
post.save!
|
55
59
|
|
@@ -1,13 +1,11 @@
|
|
1
|
-
class DocumentsController <
|
1
|
+
class DocumentsController < ApplicationController
|
2
2
|
include ActionView::Helpers::SanitizeHelper
|
3
|
-
|
3
|
+
include SocialStream::Controllers::Objects
|
4
4
|
|
5
5
|
belongs_to_subjects :optional => true
|
6
6
|
|
7
7
|
before_filter :profile_subject!, :only => :index
|
8
8
|
|
9
|
-
load_and_authorize_resource :except => :index
|
10
|
-
|
11
9
|
PER_PAGE=20
|
12
10
|
SEND_FILE_METHOD = :default
|
13
11
|
|
@@ -67,12 +65,6 @@ class DocumentsController < InheritedResources::Base
|
|
67
65
|
send_file(path, send_file_options)
|
68
66
|
end
|
69
67
|
|
70
|
-
def destroy
|
71
|
-
@post_activity = resource.post_activity
|
72
|
-
|
73
|
-
destroy!
|
74
|
-
end
|
75
|
-
|
76
68
|
private
|
77
69
|
|
78
70
|
def collection
|
@@ -1,4 +1,9 @@
|
|
1
1
|
<div id="document_info">
|
2
|
+
<% if document.description %>
|
3
|
+
<div id="description">
|
4
|
+
<%= document.description %>
|
5
|
+
</div>
|
6
|
+
<% end %>
|
2
7
|
<div id="actions">
|
3
8
|
<%= link_to content_tag(:span,image_tag("btn/btn_write.png") + t('document.actions.details'), :class => :action, :id => :document_details_action), "javascript:toggleDocumentMenu('details');" %>
|
4
9
|
<%= link_to content_tag(:span,image_tag("btn/download.png") + t('document.actions.download'), :class => :action), download_document_path(document) %>
|
@@ -4,15 +4,15 @@
|
|
4
4
|
<%= link_to thumb_for(picture, 16),
|
5
5
|
picture_path(picture),
|
6
6
|
:type => picture.type,
|
7
|
-
:title => picture.
|
7
|
+
:title => picture.title,
|
8
8
|
:path => document_path(picture) %>
|
9
9
|
</div>
|
10
10
|
|
11
11
|
<div class="attachment_text picture_summary_class picture_link">
|
12
12
|
<%= t('picture.msg') %>
|
13
|
-
<%= link_to "\""+picture.
|
13
|
+
<%= link_to "\""+picture.title+"\"",
|
14
14
|
picture_path(picture),
|
15
|
-
:alt => picture.
|
15
|
+
:alt => picture.title,
|
16
16
|
:type => picture.type,
|
17
17
|
:path => document_path(picture),
|
18
18
|
:class => "attachment_text_link" %>
|
@@ -22,7 +22,7 @@
|
|
22
22
|
<%= link_to thumb_for(picture, 130),
|
23
23
|
download_document_path(picture),
|
24
24
|
:type => picture.type,
|
25
|
-
:title => picture.
|
25
|
+
:title => picture.title,
|
26
26
|
:path => document_path(picture) %>
|
27
27
|
</div>
|
28
28
|
<% end %>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
:class => "" %>
|
6
6
|
</div>
|
7
7
|
<div class="attachment_text">
|
8
|
-
<%= t('video.msg') %><%= link_to "\""+video.
|
8
|
+
<%= t('video.msg') %><%= link_to "\""+video.title+"\"",
|
9
9
|
video,
|
10
10
|
:class => "attachment_text_link" %>
|
11
11
|
<div id="video_thumbnail_<%= video.id%>" class="video_thumbnail_class">
|