social_stream 0.23.4 → 0.24.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. data/base/app/assets/images/flags/pt.png +0 -0
  2. data/base/app/assets/javascripts/social_stream.toolbar.js +41 -0
  3. data/base/app/assets/stylesheets/settings.css +1 -0
  4. data/base/app/controllers/activity_actions_controller.rb +44 -0
  5. data/base/app/controllers/followers_controller.rb +39 -0
  6. data/base/app/helpers/activities_helper.rb +10 -10
  7. data/base/app/helpers/activity_actions_helper.rb +35 -0
  8. data/base/app/helpers/contacts_helper.rb +1 -1
  9. data/base/app/helpers/followers_helper.rb +5 -0
  10. data/base/app/helpers/toolbar_helper.rb +55 -68
  11. data/base/app/models/activity_action.rb +28 -0
  12. data/base/app/models/activity_object.rb +11 -2
  13. data/base/app/models/actor.rb +23 -33
  14. data/base/app/models/contact.rb +32 -43
  15. data/base/app/models/group.rb +2 -6
  16. data/base/app/models/relation.rb +1 -1
  17. data/base/app/models/relation/follow.rb +14 -0
  18. data/base/app/models/tie.rb +30 -30
  19. data/base/app/models/user.rb +8 -0
  20. data/base/app/views/activities/_options.html.erb +0 -1
  21. data/base/app/views/activity_actions/_follow_form.html.erb +10 -0
  22. data/base/app/views/activity_actions/_follow_sentence.html.erb +3 -0
  23. data/base/app/views/activity_actions/_update_form.js.erb +2 -0
  24. data/base/app/views/activity_actions/create.js.erb +1 -0
  25. data/base/app/views/activity_actions/update.js.erb +1 -0
  26. data/base/app/views/avatars/index.html.erb +1 -1
  27. data/base/app/views/cheesecake/index.html.erb +1 -1
  28. data/base/app/views/contacts/{_link.html.erb → _link_custom.html.erb} +0 -0
  29. data/base/app/views/contacts/_link_follow.html.erb +12 -0
  30. data/base/app/views/contacts/edit.html.erb +1 -1
  31. data/base/app/views/contacts/index.html.erb +1 -1
  32. data/base/app/views/contacts/index.js.erb +1 -1
  33. data/base/app/views/contacts/new.html.erb +1 -1
  34. data/base/app/views/conversations/index.html.erb +1 -1
  35. data/base/app/views/conversations/index.js.erb +1 -1
  36. data/base/app/views/conversations/show.html.erb +1 -1
  37. data/base/app/views/conversations/show.js.erb +1 -1
  38. data/base/app/views/devise/registrations/edit.html.erb +1 -1
  39. data/base/app/views/followers/destroy.js.erb +1 -0
  40. data/base/app/views/followers/index.html.erb +5 -0
  41. data/base/app/views/followers/update.js.erb +1 -0
  42. data/base/app/views/groups/_show.html.erb +1 -1
  43. data/base/app/views/groups/new.html.erb +1 -1
  44. data/base/app/views/layouts/_header_dropdown_menu.html.erb +5 -3
  45. data/base/app/views/messages/new.html.erb +1 -1
  46. data/base/app/views/messages/new.js.erb +1 -1
  47. data/base/app/views/objects/_show.html.erb +1 -1
  48. data/base/app/views/profiles/edit.html.erb +1 -1
  49. data/base/app/views/profiles/show.html.erb +1 -1
  50. data/base/app/views/relation/customs/index.html.erb +1 -1
  51. data/base/app/views/settings/index.html.erb +1 -1
  52. data/base/app/views/settings/index.js.erb +1 -0
  53. data/base/app/views/ties/index.html.erb +1 -1
  54. data/base/app/views/toolbar/_logo.html.erb +0 -7
  55. data/base/app/views/users/_show.html.erb +1 -1
  56. data/base/config/locales/en.yml +16 -6
  57. data/base/config/locales/es.yml +15 -6
  58. data/base/config/locales/pt.yml +507 -0
  59. data/base/config/locales/rails.pt.yml +192 -0
  60. data/base/config/routes.rb +20 -7
  61. data/base/db/migrate/20120316093946_create_activity_actions.rb +15 -0
  62. data/base/db/migrate/20120316113728_activity_action_follow.rb +23 -0
  63. data/base/lib/generators/social_stream/base/install_generator.rb +0 -4
  64. data/base/lib/generators/social_stream/base/templates/initializer.rb +7 -0
  65. data/base/lib/inherited_resources/social_stream.rb +18 -0
  66. data/base/lib/rails/social_stream.rb +23 -0
  67. data/base/lib/social_stream-base.rb +7 -3
  68. data/base/lib/social_stream/base/dependencies.rb +3 -2
  69. data/base/lib/social_stream/base/engine.rb +6 -6
  70. data/base/lib/social_stream/base/version.rb +1 -1
  71. data/base/lib/social_stream/models/channeled.rb +8 -0
  72. data/base/lib/social_stream/models/object.rb +1 -3
  73. data/base/lib/social_stream/models/subtype.rb +31 -25
  74. data/base/lib/social_stream/models/supertype.rb +54 -19
  75. data/base/lib/social_stream/views/toolbar/base.rb +143 -0
  76. data/base/lib/tasks/db/populate.rake +1 -1
  77. data/base/social_stream-base.gemspec +1 -3
  78. data/base/spec/dummy/config/initializers/social_stream.rb +7 -0
  79. data/base/spec/models/activity_action_spec.rb +26 -0
  80. data/base/spec/models/tie_spec.rb +2 -2
  81. data/documents/app/views/common_documents/_headers.html.erb +1 -1
  82. data/documents/lib/social_stream-documents.rb +4 -2
  83. data/documents/lib/social_stream/documents/engine.rb +3 -3
  84. data/documents/lib/social_stream/documents/version.rb +1 -1
  85. data/documents/lib/social_stream/views/toolbar/documents.rb +28 -0
  86. data/documents/social_stream-documents.gemspec +1 -1
  87. data/events/app/assets/javascripts/social_stream.event.js +33 -0
  88. data/events/app/assets/stylesheets/events.css.scss +37 -0
  89. data/events/app/views/events/_event.html.erb +3 -44
  90. data/events/app/views/events/_event_date.html.erb +20 -0
  91. data/events/app/views/events/_event_date_sidebar.html.erb +14 -0
  92. data/events/app/views/events/_event_details.html.erb +21 -0
  93. data/events/app/views/events/_event_poster.html.erb +9 -0
  94. data/events/app/views/events/_event_sidebar.html.erb +10 -0
  95. data/events/app/views/events/index.html.erb +1 -1
  96. data/events/app/views/events/index.js.erb +1 -1
  97. data/events/config/locales/en.yml +6 -0
  98. data/events/config/locales/es.yml +7 -0
  99. data/events/lib/social_stream/events/version.rb +1 -1
  100. data/events/social_stream-events.gemspec +2 -2
  101. data/lib/social_stream/version.rb +1 -1
  102. data/linkser/lib/social_stream/linkser/version.rb +1 -1
  103. data/linkser/social_stream-linkser.gemspec +1 -1
  104. data/presence/app/assets/images/games/sfighter/abobo/abobo.png +0 -0
  105. data/presence/app/assets/images/games/sfighter/abobo/abobo_block_81x130x1.png +0 -0
  106. data/presence/app/assets/images/games/sfighter/abobo/abobo_die_156x119x1.png +0 -0
  107. data/presence/app/assets/images/games/sfighter/abobo/abobo_hit_108x120x3.png +0 -0
  108. data/presence/app/assets/images/games/sfighter/abobo/abobo_idle_100x121x3.png +0 -0
  109. data/presence/app/assets/images/games/sfighter/abobo/abobo_kick_137x130x2.png +0 -0
  110. data/presence/app/assets/images/games/sfighter/abobo/abobo_punch_131x170x4.png +0 -0
  111. data/presence/app/assets/images/games/sfighter/abobo/abobo_walk_backward_94x126x6.png +0 -0
  112. data/presence/app/assets/images/games/sfighter/abobo/abobo_walk_forward_94x126x6.png +0 -0
  113. data/presence/app/assets/images/games/sfighter/cvs/cvs_block_69x99x2.png +0 -0
  114. data/presence/app/assets/images/games/sfighter/cvs/cvs_die_150x110x1.png +0 -0
  115. data/presence/app/assets/images/games/sfighter/cvs/cvs_hit_59x103x1.png +0 -0
  116. data/presence/app/assets/images/games/sfighter/cvs/cvs_idle_59x106x6.png +0 -0
  117. data/presence/app/assets/images/games/sfighter/cvs/cvs_kick_156x106x9.png +0 -0
  118. data/presence/app/assets/images/games/sfighter/cvs/cvs_punch_120x104x6.png +0 -0
  119. data/presence/app/assets/images/games/sfighter/cvs/cvs_walk_backward_58x106x5.png +0 -0
  120. data/presence/app/assets/images/games/sfighter/cvs/cvs_walk_forward_58x106x5.png +0 -0
  121. data/presence/app/assets/images/games/sfighter/stage/background1.png +0 -0
  122. data/presence/app/assets/images/games/sfighter/stage/background2.png +0 -0
  123. data/presence/app/assets/images/games/sfighter/stage/background3.png +0 -0
  124. data/presence/app/assets/images/games/sfighter/stage/foreground.png +0 -0
  125. data/presence/app/assets/images/games/sfighter/stage/ground.png +0 -0
  126. data/presence/app/assets/images/games/sfighter/thumbnail.png +0 -0
  127. data/presence/app/assets/images/games/ter/classic_circle.png +0 -0
  128. data/presence/app/assets/images/games/ter/classic_thumbnail.png +0 -0
  129. data/presence/app/assets/images/games/ter/modern_thumbnail.png +0 -0
  130. data/presence/app/assets/images/webcam.png +0 -0
  131. data/presence/app/assets/javascripts/jquery.ui.chatbox.sstreampresence.js +2 -2
  132. data/presence/app/assets/javascripts/presence_XmppClient.js.erb +3 -1
  133. data/presence/app/assets/javascripts/presence_game.js.erb +13 -6
  134. data/presence/app/assets/javascripts/presence_game_comunication.js.erb +83 -13
  135. data/presence/app/assets/javascripts/presence_game_factory.js.erb +47 -0
  136. data/presence/app/assets/javascripts/presence_game_interface.js.erb +143 -53
  137. data/presence/app/assets/javascripts/presence_game_sfighter.js.erb +583 -0
  138. data/presence/app/assets/javascripts/presence_game_ter.js.erb +20 -9
  139. data/presence/app/assets/javascripts/presence_uiManager.js.erb +0 -2
  140. data/presence/app/assets/javascripts/presence_utilities.js +1 -1
  141. data/presence/app/assets/javascripts/presence_videochat.js.erb +5 -0
  142. data/presence/app/assets/javascripts/social_stream-presence.js +1 -0
  143. data/presence/app/assets/stylesheets/chat.css.scss +59 -6
  144. data/presence/config/locales/en.yml +1 -1
  145. data/presence/config/locales/es.yml +1 -1
  146. data/presence/lib/social_stream-presence.rb +4 -0
  147. data/presence/lib/social_stream/presence/engine.rb +6 -0
  148. data/presence/lib/social_stream/presence/version.rb +1 -1
  149. data/presence/lib/social_stream/views/toolbar/presence.rb +28 -0
  150. data/presence/social_stream-presence.gemspec +1 -1
  151. data/social_stream.gemspec +5 -5
  152. metadata +92 -41
  153. data/base/app/assets/javascripts/toolbar.js +0 -22
  154. data/base/app/views/layouts/_settings.html.erb +0 -18
  155. data/base/app/views/toolbar/_home.html.erb +0 -15
  156. data/base/app/views/toolbar/_messages.html.erb +0 -15
  157. data/base/app/views/toolbar/_profile.html.erb +0 -28
  158. data/base/lib/generators/social_stream/base/templates/navigation.rb +0 -4
  159. data/base/lib/social_stream/toolbar_config/base.rb +0 -94
  160. data/documents/lib/social_stream/toolbar_config/documents.rb +0 -27
  161. data/events/lib/social_stream/toolbar_config/events.rb +0 -22
@@ -38,9 +38,7 @@ module SocialStream
38
38
 
39
39
  # Build the post activity when this object is not saved
40
40
  def build_post_activity
41
- Activity.new :author => author,
42
- :user_author => user_author,
43
- :owner => owner,
41
+ Activity.new :channel => channel!,
44
42
  :relation_ids => Array(_relation_ids)
45
43
  end
46
44
 
@@ -1,21 +1,12 @@
1
1
  module SocialStream #:nodoc:
2
2
  module Models
3
3
  # Common methods for models that have a {SocialStream::Models::Supertype}
4
+ #
5
+ # Examples of subtypes are {User} and {Group}, which have {Actor} as supertype,
6
+ # or {Post} and {Comment}, which have {ActivityObject} as supertype
7
+ #
8
+ # Methods are documented taking User as example of {SocialStream::Models::Subtype}
4
9
  module Subtype
5
- # Add the class method {#subtype_of} to ActiveRecord::Base
6
- module ActiveRecord
7
- extend ActiveSupport::Concern
8
-
9
- module ClassMethods
10
- # This class is a subtype. Its supertype class is name
11
- def subtype_of name, options = {}
12
- @supertype_name = name
13
- @supertype_options = options
14
- include SocialStream::Models::Subtype
15
- end
16
- end
17
- end
18
-
19
10
  extend ActiveSupport::Concern
20
11
 
21
12
  included do
@@ -23,29 +14,30 @@ module SocialStream #:nodoc:
23
14
  attr_reader :supertype_name, :supertype_options
24
15
  end
25
16
 
26
- belongs_to supertype_name, {
27
- :validate => true,
28
- :autosave => true,
29
- :dependent => :destroy
30
- }.merge(supertype_options[:belongs] || {})
17
+ belongs_to supertype_name, { # belongs_to :actor, {
18
+ :validate => true, # :validate => true
19
+ :autosave => true, # :autosave => true
20
+ :dependent => :destroy # :dependent => :destroy
21
+ }.merge(supertype_options[:belongs] || {}) # }.merge(supertype_options[:belongs] || {})
31
22
 
32
23
  class_eval <<-EOS
33
- def #{ supertype_name }! # def actor!
34
- #{ supertype_name } || # actor ||
24
+ def #{ supertype_name }! # def actor!
25
+ #{ supertype_name } || # actor ||
35
26
  # FIXME: ruby1.9 remove .inspect
36
27
  build_#{ supertype_name }(#{ supertype_options[:build].inspect }) # build_actor(:subject_type => "User")
37
- end # end
28
+ end # end
38
29
 
39
30
  EOS
40
31
 
41
- alias_method :supertype!, "#{ supertype_name }!"
32
+ alias_method :supertype!, "#{ supertype_name }!" # alias_method :supertype!, :actor!
42
33
 
43
- before_validation :supertype!
34
+ # Load the supertype to ensure it is saved along with this instance
35
+ before_validation :supertype! # before_validation :actor!
44
36
  end
45
37
 
46
38
  module ClassMethods
47
39
  def supertype_foreign_key
48
- "#{ supertype_name }_id"
40
+ "#{ supertype_name }_id" # "actor_id"
49
41
  end
50
42
  end
51
43
 
@@ -77,6 +69,20 @@ module SocialStream #:nodoc:
77
69
 
78
70
  ! exceptions.include?(method)
79
71
  end
72
+
73
+ # Add the class method {#subtype_of} to ActiveRecord::Base
74
+ module ActiveRecord
75
+ extend ActiveSupport::Concern
76
+
77
+ module ClassMethods
78
+ # This class is a subtype. Its supertype class is name
79
+ def subtype_of name, options = {}
80
+ @supertype_name = name
81
+ @supertype_options = options
82
+ include SocialStream::Models::Subtype
83
+ end
84
+ end
85
+ end
80
86
  end
81
87
  end
82
88
  end
@@ -2,36 +2,58 @@ module SocialStream #:nodoc:
2
2
  module Models
3
3
  # Common methods for models having many {SocialStream::Models::Subtype subtypes}.
4
4
  # Currently, there are two {SocialStream::Models::Supertype supertypes}:
5
- # * {Actor}: participates in the social network and has {Tie Ties} with other actors. Its subtypes are {SocialStream::Models::Subject subjects}, such as {User} or {Group}
6
- # * {ActivityObject}: created and managed by {Actor Actors} in {Activity Activities}. Its subtypes are {SocialStream::Models::Object objects}, like {Post} or {Comment}
5
+ # * {Actor}: participates in the social network and has {Tie Ties} with other actors.
6
+ # Its subtypes are {SocialStream::Models::Subject subjects}, such as {User} or {Group}
7
+ # * {ActivityObject}: created and managed by {Actor Actors} in {Activity Activities}.
8
+ # Its subtypes are {SocialStream::Models::Object objects}, like {Post} or {Comment}
9
+ #
10
+ # Methods are documented for the case of {Actor} supertype
7
11
  module Supertype
8
- # Include the class method {#supertype_of} to ActiveRecord::Base
9
- module ActiveRecord
10
- extend ActiveSupport::Concern
11
-
12
- module ClassMethods
13
- # This class is a supertype. Subtype classes are known as name
14
- def supertype_of name
15
- @subtypes_name = name
16
- include SocialStream::Models::Supertype
17
- end
18
- end
19
- end
20
12
  extend ActiveSupport::Concern
21
13
 
22
14
  included do
23
- subtypes.each do |s|
24
- has_one s, :dependent => :destroy
25
- end
15
+ subtypes.each do |s| # [ :user, :group ].each do |s|
16
+ has_one s, :dependent => :destroy # has_one s, :dependent => :destroy
17
+ end # end
26
18
  end
27
19
 
28
20
  module ClassMethods
29
- def subtypes_name
21
+ def subtypes_name # :subject
30
22
  @subtypes_name
31
23
  end
32
24
 
33
25
  def subtypes
34
- SocialStream.__send__ subtypes_name.to_s.tableize # SocialStream.subjects # in Actor
26
+ SocialStream.__send__ subtypes_name.to_s.tableize # SocialStream.subjects # => [:user, :group ]
27
+ end
28
+
29
+ # Get the supertype id from an object, if possible
30
+ def normalize_id(a)
31
+ case a
32
+ when Integer
33
+ a
34
+ when Array
35
+ a.map{ |e| normalize_id(e) }
36
+ else
37
+ normalize(a).id
38
+ end
39
+ end
40
+
41
+ # Get supertype from object, if possible
42
+ def normalize(a)
43
+ case a
44
+ when self
45
+ a
46
+ when Integer
47
+ find a
48
+ when Array
49
+ a.map{ |e| normalize(e) }
50
+ else
51
+ begin
52
+ a.supertype!
53
+ rescue
54
+ raise "Unable to normalize #{ self } #{ a.inspect }"
55
+ end
56
+ end
35
57
  end
36
58
  end
37
59
 
@@ -41,6 +63,19 @@ module SocialStream #:nodoc:
41
63
  __send__ object_class.constantize.base_class.to_s.underscore # __send__ "document"
42
64
  end # end
43
65
  end
66
+
67
+ # Include the class method {#supertype_of} to ActiveRecord::Base
68
+ module ActiveRecord
69
+ extend ActiveSupport::Concern
70
+
71
+ module ClassMethods
72
+ # This class is a supertype. Subtype classes are known as name
73
+ def supertype_of name
74
+ @subtypes_name = name
75
+ include SocialStream::Models::Supertype
76
+ end
77
+ end
78
+ end
44
79
  end
45
80
  end
46
81
  end
@@ -0,0 +1,143 @@
1
+ module SocialStream
2
+ module Views
3
+ module Toolbar
4
+ module Base
5
+ def toolbar_items type, options = {}
6
+ SocialStream::Views::List.new.tap do |items|
7
+ case type
8
+ when :home, :messages
9
+ items << {
10
+ :key => :subject,
11
+ :html => render(:partial => 'toolbar/subject')
12
+ }
13
+
14
+ items << {
15
+ :key => :menu,
16
+ :html => toolbar_menu(type, options)
17
+ }
18
+ when :profile
19
+ subject = options[:subject]
20
+ raise "Need a subject options for profile toolbar" if subject.blank?
21
+
22
+ items << {
23
+ :key => :logo,
24
+ :html => render(:partial => 'toolbar/logo', :locals => { :subject => subject })
25
+ }
26
+
27
+ items << {
28
+ :key => :menu,
29
+ :html => toolbar_menu(type, options)
30
+ }
31
+ end
32
+ end
33
+ end
34
+
35
+ def toolbar_menu_items type, options = {}
36
+ SocialStream::Views::List.new.tap do |items|
37
+ case type
38
+ when :home
39
+ #Contacts
40
+ items << {
41
+ :key => :contacts,
42
+ :html => link_to(image_tag("btn/btn_friend.png")+t('contact.other'), "#", :id => 'toolbar_menu-contacts'),
43
+ :items => [
44
+ {
45
+ :key => :current,
46
+ :html => link_to(image_tag("btn/btn_friend.png")+t('contact.current'), contacts_path)
47
+ },
48
+ {
49
+ :key => :contacts_graph,
50
+ :html => link_to(image_tag("btn/btn_friend.png")+t('contact.graph.one'), ties_path)
51
+ },
52
+ {
53
+ :key => :pending,
54
+ :html => link_to(image_tag("btn/btn_friend.png")+t('contact.pending.other'), pending_contacts_path)
55
+ },
56
+ {
57
+ :key => :invitations,
58
+ :html => link_to(image_tag("btn/btn_invitation.png")+t('invitation.toolbar'), new_invitation_path)
59
+ }
60
+ ]
61
+ }
62
+
63
+ # Groups
64
+ items << {
65
+ :key => :groups,
66
+ :html => link_to(image_tag("btn/btn_group.png") + t('group.other'), '#', :id => "toolbar_menu-groups"),
67
+ :items => [
68
+ {
69
+ :key => :new_group ,
70
+ :html => link_to(image_tag("btn/btn_group.png")+t('group.new.action'), new_group_path)
71
+ }
72
+ ]
73
+ }
74
+ when :profile
75
+ subject = options[:subject]
76
+ raise "Need a subject options for profile toolbar" if subject.blank?
77
+
78
+ #Information button
79
+ items << {
80
+ :key => :subject_info,
81
+ :html => link_to(image_tag("btn/btn_edit.png")+t('menu.information'), [subject, :profile])
82
+ }
83
+
84
+ if subject != current_subject
85
+ #Like button
86
+ items << {
87
+ :key => :like_button,
88
+ :html => link_to(link_like_params(subject)[0],
89
+ link_like_params(subject)[1],
90
+ :id => link_like_params(subject)[2])
91
+ }
92
+
93
+ if user_signed_in?
94
+ #Relation button
95
+ items << {
96
+ :key => :subject_relation,
97
+ :html => link_to(image_tag("btn/btn_friend.png") + current_subject.contact_to!(subject).status,
98
+ edit_contact_path(current_subject.contact_to!(subject)))
99
+ }
100
+
101
+ #Send message button
102
+ items << {
103
+ :key => :send_message,
104
+ :html => link_to(image_tag("btn/btn_send.png")+t('message.send'),
105
+ new_message_path(:receiver => subject.slug))
106
+ }
107
+ end
108
+ end
109
+ when :messages
110
+ # Messages
111
+ items << {
112
+ :key => :message_new,
113
+ :html => link_to(image_tag("btn/message_new.png")+ t('message.new'),
114
+ new_message_path,
115
+ :remote=> false)
116
+ }
117
+
118
+ items << {
119
+ :key => :message_inbox,
120
+ :html => link_to(image_tag("btn/message_inbox.png")+t('message.inbox')+' (' + current_subject.unread_messages_count.to_s + ')',
121
+ conversations_path,
122
+ :remote=> false)
123
+ }
124
+
125
+ items << {
126
+ :key => :message_sentbox,
127
+ :html => link_to(image_tag("btn/message_sentbox.png")+t('message.sentbox'),
128
+ conversations_path(:box => :sentbox),
129
+ :remote=> false)
130
+ }
131
+
132
+ items << {
133
+ :key => :message_trash,
134
+ :html => link_to(image_tag("btn/message_trash.png")+t('message.trash'),
135
+ conversations_path(:box => :trash))
136
+ }
137
+ end
138
+ end
139
+ end
140
+ end
141
+ end
142
+ end
143
+ end
@@ -266,7 +266,7 @@ namespace :db do
266
266
  if avatar.present? && File.exists?(avatar)
267
267
  Avatar.copy_to_temp_file(avatar)
268
268
  dimensions = Avatar.get_image_dimensions(avatar)
269
- l = Avatar.new(:actor => i.actor,:logo => File.open(avatar), :name => File.basename(avatar), :crop_x => 0, :crop_y => 0, :crop_w => dimensions[:width], :crop_h => dimensions[:height] )
269
+ l = Avatar.new(:actor => i.actor, :name => File.basename(avatar), :crop_x => 0, :crop_y => 0, :crop_w => dimensions[:width], :crop_h => dimensions[:height] )
270
270
  l.active = true
271
271
  l.save!
272
272
  end
@@ -28,7 +28,7 @@ Gem::Specification.new do |s|
28
28
  # Slug generation
29
29
  s.add_runtime_dependency('stringex', '~> 1.3.0')
30
30
  # Avatar attachments
31
- s.add_runtime_dependency('avatars_for_rails', '~> 0.2.2')
31
+ s.add_runtime_dependency('avatars_for_rails', '~> 0.2.5')
32
32
  # jQuery
33
33
  s.add_runtime_dependency('jquery-rails', '>= 1.0.9')
34
34
  # Authorization
@@ -45,8 +45,6 @@ Gem::Specification.new do |s|
45
45
  s.add_runtime_dependency('acts-as-taggable-on','~> 2.2.2')
46
46
  # HTML Forms
47
47
  s.add_runtime_dependency('formtastic','~> 1.2.3')
48
- # Simple navigation for menu
49
- s.add_runtime_dependency('simple-navigation', '~> 3.5.1')
50
48
  # Background jobs
51
49
  s.add_runtime_dependency('resque','~> 1.20.0')
52
50
  # Modernizr.js javascript library
@@ -20,6 +20,13 @@ SocialStream.setup do |config|
20
20
  # You can write your own activity objects
21
21
  #
22
22
  # config.activity_forms = [ :post, :document, :foo, :bar ]
23
+
24
+ # Config the relation model of your network
25
+ #
26
+ # :custom - users define their own relation types, and post with privacy, like Google+
27
+ # :follow - user just follow other users, like Twitter
28
+ #
29
+ # config.relation_model = :custom
23
30
 
24
31
  # Quick search (header) and Extended search models and its order. Remember to create
25
32
  # the indexes with thinking-sphinx if you are using customized models.
@@ -0,0 +1,26 @@
1
+ require 'spec_helper'
2
+
3
+ describe ActivityAction do
4
+ context "a following contact" do
5
+ before do
6
+ @tie = Factory(:friend)
7
+ end
8
+
9
+ it "should create follow action" do
10
+ action = @tie.sender.action_to(@tie.receiver)
11
+
12
+ action.should be_present
13
+ action.should be_follow
14
+ end
15
+
16
+ it "should remove follow action" do
17
+ action = @tie.sender.action_to(@tie.receiver)
18
+
19
+ action.should be_present
20
+
21
+ @tie.destroy
22
+
23
+ action.reload.should_not be_follow
24
+ end
25
+ end
26
+ end
@@ -13,8 +13,8 @@ describe Tie do
13
13
  merge(Permission.follow).
14
14
  first
15
15
 
16
- Tie.create :contact_id => sender.contact_to!(receiver).id,
17
- :relation_id => follower_relation.id
16
+ Tie.create! :contact_id => sender.contact_to!(receiver).id,
17
+ :relation_id => follower_relation.id
18
18
 
19
19
  receiver.reload.follower_count.should eq(count + 1)
20
20
  end
@@ -15,7 +15,7 @@
15
15
  ) %>
16
16
  <%end%>
17
17
 
18
- <% toolbar :profile => profile_subject %>
18
+ <% toolbar :profile, :subject => profile_subject %>
19
19
  <br class="clearfloat" />
20
20
  <div class="space_center"></div>
21
21
  <div id="repository_filter">
@@ -1,8 +1,10 @@
1
1
  require 'social_stream/documents/dependencies'
2
2
 
3
3
  module SocialStream
4
- module ToolbarConfig
5
- autoload :Documents, 'social_stream/toolbar_config/documents'
4
+ module Views
5
+ module Toolbar
6
+ autoload :Documents, 'social_stream/views/toolbar/documents'
7
+ end
6
8
  end
7
9
 
8
10
  module Documents