social_stream 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/activities_controller.rb +1 -0
- data/app/controllers/avatars_controller.rb +17 -10
- data/app/controllers/comments_controller.rb +2 -0
- data/app/controllers/conversations_controller.rb +98 -103
- data/app/controllers/groups_controller.rb +3 -1
- data/app/controllers/likes_controller.rb +2 -0
- data/app/controllers/messages_controller.rb +4 -0
- data/app/controllers/posts_controller.rb +2 -2
- data/app/controllers/ties_controller.rb +6 -0
- data/app/helpers/subjects_helper.rb +32 -7
- data/app/helpers/ties_helper.rb +7 -2
- data/app/models/activity.rb +1 -1
- data/app/models/actor.rb +5 -8
- data/app/models/relation.rb +65 -0
- data/app/models/tie.rb +27 -7
- data/app/views/activities/_child.html.erb +1 -5
- data/app/views/activities/_root.html.erb +2 -4
- data/app/views/avatars/_form.html.erb +5 -16
- data/app/views/avatars/_precrop.html.erb +24 -17
- data/app/views/avatars/index.html.erb +47 -36
- data/app/views/avatars/new.html.erb +19 -3
- data/app/views/contacts/index.html.erb +1 -1
- data/app/views/contacts/index.js.erb +2 -0
- data/app/views/conversations/_conversation_full.html.erb +2 -1
- data/app/views/conversations/_index.html.erb +0 -7
- data/app/views/conversations/_show.html.erb +0 -7
- data/app/views/conversations/index.html.erb +9 -1
- data/app/views/conversations/index.js.erb +1 -0
- data/app/views/conversations/show.html.erb +1 -1
- data/app/views/conversations/show.js.erb +2 -0
- data/app/views/groups/_new.html.erb +9 -2
- data/app/views/groups/new.html.erb +5 -1
- data/app/views/layouts/_header.erb +23 -1
- data/app/views/layouts/_representation.html.erb +1 -1
- data/app/views/messages/new.html.erb +1 -1
- data/app/views/messages/new.js.erb +3 -0
- data/app/views/profiles/_profile.html.erb +18 -13
- data/app/views/profiles/edit.html.erb +29 -4
- data/app/views/profiles/update.js.erb +3 -3
- data/app/views/subjects/_toolbar_home_menu_options.html.erb +1 -1
- data/app/views/subjects/_toolbar_home_menu_options_subjects.html.erb +2 -2
- data/app/views/subjects/_toolbar_logo.html.erb +14 -2
- data/app/views/subjects/_toolbar_message_menu.html.erb +1 -1
- data/app/views/subjects/_toolbar_profile_menu_tie_options.html.erb +18 -7
- data/app/views/ties/_edit.html.erb +102 -0
- data/app/views/ties/_new.html.erb +48 -19
- data/app/views/ties/edit.html.erb +1 -0
- data/config/locales/en.yml +42 -27
- data/config/routes.rb +0 -6
- data/lib/generators/social_stream/templates/public/images/btn/arrowBlue.png +0 -0
- data/lib/generators/social_stream/templates/public/images/btn/shadow.png +0 -0
- data/lib/generators/social_stream/templates/public/javascripts/addContact.js +100 -0
- data/lib/generators/social_stream/templates/public/javascripts/avatars.js +8 -0
- data/lib/generators/social_stream/templates/public/javascripts/hoverIntent.js +84 -0
- data/lib/generators/social_stream/templates/public/javascripts/main.js +10 -1
- data/lib/generators/social_stream/templates/public/javascripts/menu.js +22 -6
- data/lib/generators/social_stream/templates/public/stylesheets/default/activities.css +2 -2
- data/lib/generators/social_stream/templates/public/stylesheets/default/addContact.css +29 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/avatars.css +79 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/base.css +44 -5
- data/lib/generators/social_stream/templates/public/stylesheets/default/header.css +151 -1
- data/lib/generators/social_stream/templates/public/stylesheets/default/home.css +1 -1
- data/lib/generators/social_stream/templates/public/stylesheets/default/jquery-ui.css +1 -1
- data/lib/generators/social_stream/templates/public/stylesheets/default/messages.css +6 -4
- data/lib/social_stream.rb +1 -1
- data/lib/social_stream/ability.rb +20 -0
- data/lib/social_stream/models/subject.rb +5 -1
- data/lib/social_stream/test_helpers/controllers.rb +55 -0
- data/lib/social_stream/version.rb +1 -1
- data/social_stream.gemspec +1 -1
- data/spec/controllers/comments_controller_spec.rb +38 -0
- data/spec/controllers/groups_controller_spec.rb +75 -5
- data/spec/factories/comment.rb +4 -0
- data/spec/models/tie_spec.rb +25 -15
- metadata +18 -10
- data/app/controllers/pshb_controller.rb +0 -55
- data/app/views/ties/new.js.erb +0 -12
- data/lib/social_stream/relations.rb +0 -46
@@ -1,55 +0,0 @@
|
|
1
|
-
class PshbController < ApplicationController
|
2
|
-
|
3
|
-
def callback
|
4
|
-
#sync subscription verification
|
5
|
-
if params['hub.mode']=='subscribe'
|
6
|
-
render :text => params['hub.challenge'], :status => 200
|
7
|
-
# TO-DO: confirm that params['hub.topic'] is a real
|
8
|
-
# requested subscription by someone in this node
|
9
|
-
end
|
10
|
-
|
11
|
-
#sync unsubscription verification
|
12
|
-
if params['hub.mode']=='unsubscribe'
|
13
|
-
render :text => params['hub.challenge'], :status => 200
|
14
|
-
# TO-DO: confirm that params['hub.topic'] is a real
|
15
|
-
# requested unsubscription by someone in this node
|
16
|
-
# and delete permissions/remote actor if necessary
|
17
|
-
end
|
18
|
-
|
19
|
-
logger.debug request.body.read
|
20
|
-
end
|
21
|
-
|
22
|
-
require "net/http"
|
23
|
-
require "uri"
|
24
|
-
|
25
|
-
def pshb_subscription_request#(topic,hub,mode)
|
26
|
-
t = Thread.new do
|
27
|
-
#test
|
28
|
-
hub = 'http://138.4.7.113:4567/' # last '/' is mandatory!
|
29
|
-
topic = 'http://138.4.7.69:3000/api/user/demo/home.atom'
|
30
|
-
mode = 'subscribe'
|
31
|
-
#
|
32
|
-
uri = URI.parse(hub)
|
33
|
-
response = Net::HTTP::post_form(uri,{ 'hub.callback' => pshb_callback_url,
|
34
|
-
'hub.mode' => mode,
|
35
|
-
'hub.topic' => topic,
|
36
|
-
'hub.verify' => 'sync'})
|
37
|
-
puts response.body
|
38
|
-
#TO-DO: process 4XX response.status
|
39
|
-
end
|
40
|
-
end
|
41
|
-
|
42
|
-
def pshb_publish#(topic,hub)
|
43
|
-
t = Thread.new do
|
44
|
-
#test params
|
45
|
-
hub = 'http://138.4.7.113:4567/' # last '/' is mandatory!
|
46
|
-
topic = 'http://138.4.7.69:3000/api/user/demo/home.atom'
|
47
|
-
#
|
48
|
-
uri = URI.parse(hub)
|
49
|
-
response = Net::HTTP::post_form(uri,{ 'hub.mode' => 'publish',
|
50
|
-
'hub.url' => topic})
|
51
|
-
#TO-DO: process 4XX response.status
|
52
|
-
end
|
53
|
-
end
|
54
|
-
|
55
|
-
end
|
data/app/views/ties/new.js.erb
DELETED
@@ -1,12 +0,0 @@
|
|
1
|
-
if(!show_add_contact){
|
2
|
-
var previous_content = $('#content').html();
|
3
|
-
var show_add_contact = true;
|
4
|
-
}
|
5
|
-
|
6
|
-
<%= toolbar(:profile => @tie.receiver_subject).html_safe %>
|
7
|
-
|
8
|
-
$('#content').html("<%= escape_javascript(render(:partial => "ties/new")) %>");
|
9
|
-
|
10
|
-
$('#close_add_contact').click(function() {
|
11
|
-
$('#content').html(previous_content);
|
12
|
-
});
|
@@ -1,46 +0,0 @@
|
|
1
|
-
module SocialStream
|
2
|
-
# Seed you database with initial data for SocialStream
|
3
|
-
#
|
4
|
-
module Relations
|
5
|
-
CONFIG = File.join(::Rails.root, 'config', 'relations.yml')
|
6
|
-
|
7
|
-
class << self
|
8
|
-
# Relations configuration
|
9
|
-
def config
|
10
|
-
@config ||= YAML.load_file(CONFIG)
|
11
|
-
end
|
12
|
-
|
13
|
-
def create(model)
|
14
|
-
cfg_rels = config[model.singularize.underscore]
|
15
|
-
|
16
|
-
if cfg_rels.nil?
|
17
|
-
raise "Undefined relations for actor #{ model }. Please, add an entry to #{ CONFIG }"
|
18
|
-
end
|
19
|
-
|
20
|
-
rels = {}
|
21
|
-
|
22
|
-
cfg_rels.each_pair do |name, cfg_rel|
|
23
|
-
rels[name] =
|
24
|
-
Relation.create! :sender_type => model,
|
25
|
-
:receiver_type => cfg_rel['receiver_type'],
|
26
|
-
:name => cfg_rel['name']
|
27
|
-
|
28
|
-
if (ps = cfg_rel['permissions']).present?
|
29
|
-
ps.each do |p|
|
30
|
-
rels[name].permissions <<
|
31
|
-
Permission.find_or_create_by_action_and_object_and_function(*p)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
35
|
-
|
36
|
-
# Parent, relations must be set after creation
|
37
|
-
# FIXME: Can fix with ruby 1.9 and ordered hashes
|
38
|
-
cfg_rels.each_pair do |name, cfg_rel|
|
39
|
-
rels[name].update_attribute(:parent, rels[cfg_rel['parent']]) if cfg_rel['parent'].present?
|
40
|
-
end
|
41
|
-
|
42
|
-
rels.values
|
43
|
-
end
|
44
|
-
end
|
45
|
-
end
|
46
|
-
end
|