social_stream 0.2.3 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (135) hide show
  1. data/.gitignore +1 -0
  2. data/README.rdoc +2 -3
  3. data/app/controllers/likes_controller.rb +2 -2
  4. data/app/controllers/messages_controller.rb +3 -0
  5. data/app/controllers/representations_controller.rb +8 -0
  6. data/app/controllers/ties_controller.rb +1 -1
  7. data/app/helpers/activities_helper.rb +2 -2
  8. data/app/helpers/ties_helper.rb +19 -16
  9. data/app/models/activity.rb +42 -7
  10. data/app/models/activity_object.rb +1 -0
  11. data/app/models/activity_verb.rb +5 -1
  12. data/app/models/actor.rb +113 -68
  13. data/app/models/group.rb +15 -1
  14. data/app/models/message.rb +2 -0
  15. data/app/models/permission.rb +20 -41
  16. data/app/models/profile.rb +1 -1
  17. data/app/models/relation.rb +34 -26
  18. data/app/models/representation.rb +35 -0
  19. data/app/models/tie.rb +47 -100
  20. data/app/models/user.rb +12 -17
  21. data/app/views/activities/_activities.html.erb +2 -2
  22. data/app/views/activities/_new.html.erb +6 -3
  23. data/app/views/activities/_options.html.erb +1 -1
  24. data/app/views/comments/_new.html.erb +2 -2
  25. data/app/views/frontpage/index.html.erb +0 -2
  26. data/app/views/groups/_group.html.erb +3 -3
  27. data/app/views/groups/_index.html.erb +3 -4
  28. data/app/views/groups/_middle_show.html.erb +7 -4
  29. data/app/views/groups/_new.html.erb +25 -0
  30. data/app/views/groups/_right_show.html.erb +4 -2
  31. data/app/views/groups/new.html.erb +1 -0
  32. data/app/views/groups/show.html.erb +1 -1
  33. data/app/views/home/_groups.html.erb +7 -5
  34. data/app/views/home/_location.html.erb +1 -1
  35. data/app/views/home/_options.html.erb +2 -2
  36. data/app/views/home/_right.html.erb +2 -2
  37. data/app/views/home/index.html.erb +6 -2
  38. data/app/views/layouts/_footer.html.erb +1 -1
  39. data/app/views/layouts/_header.erb +4 -1
  40. data/app/views/layouts/_representation.html.erb +20 -0
  41. data/app/views/{private_messages → messages}/_form.html.erb +4 -4
  42. data/app/views/{private_messages → messages}/_index.html.erb +1 -1
  43. data/app/views/{private_messages → messages}/_location.html.erb +1 -1
  44. data/app/views/messages/_message.html.erb +17 -0
  45. data/app/views/messages/_messages.html.erb +2 -0
  46. data/app/views/messages/edit.html.erb +6 -0
  47. data/app/views/{private_messages → messages}/index.html.erb +0 -0
  48. data/app/views/{private_messages → messages}/index.js.erb +0 -0
  49. data/app/views/{private_messages → messages}/new.html.erb +2 -2
  50. data/app/views/messages/show.html.erb +21 -0
  51. data/app/views/subjects/_contacts.html.erb +20 -0
  52. data/app/views/ties/_new.html.erb +6 -6
  53. data/app/views/ties/_pendings.html.erb +3 -3
  54. data/app/views/ties/_suggestions.html.erb +3 -3
  55. data/app/views/ties/_tie.html.erb +1 -1
  56. data/app/views/ties/create.js.erb +4 -5
  57. data/app/views/ties/new.js.erb +1 -1
  58. data/app/views/users/_groups.html.erb +5 -5
  59. data/app/views/users/_index.html.erb +3 -1
  60. data/app/views/users/_options.html.erb +1 -1
  61. data/app/views/users/_right_show.html.erb +3 -3
  62. data/app/views/users/show.html.erb +5 -3
  63. data/config/locales/en.yml +13 -19
  64. data/config/routes.rb +11 -4
  65. data/lib/generators/social_stream/install_generator.rb +2 -10
  66. data/lib/generators/social_stream/templates/initializer.rb +1 -1
  67. data/lib/generators/social_stream/templates/migration.rb +19 -24
  68. data/lib/generators/social_stream/templates/public/javascripts/jquery.js +6883 -0
  69. data/lib/generators/social_stream/templates/public/javascripts/rails.js +146 -0
  70. data/lib/generators/social_stream/templates/public/javascripts/ui.dropdownchecklist.js +3 -13
  71. data/lib/generators/social_stream/templates/public/stylesheets/header.css +5 -1
  72. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
  73. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-bg_flat_75_ffffff_40x100.png +0 -0
  74. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
  75. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-bg_glass_65_ffffff_1x400.png +0 -0
  76. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-bg_glass_75_dadada_1x400.png +0 -0
  77. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
  78. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-bg_glass_95_fef1ec_1x400.png +0 -0
  79. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
  80. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-icons_222222_256x240.png +0 -0
  81. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-icons_2e83ff_256x240.png +0 -0
  82. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-icons_454545_256x240.png +0 -0
  83. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-icons_888888_256x240.png +0 -0
  84. data/lib/generators/social_stream/templates/public/{images → stylesheets/images}/ui-icons_cd0a0a_256x240.png +0 -0
  85. data/lib/generators/social_stream/templates/relations.yml +42 -0
  86. data/lib/social_stream/ability.rb +7 -6
  87. data/lib/social_stream/controllers/helpers.rb +35 -0
  88. data/lib/social_stream/models/{activity_object.rb → object.rb} +1 -1
  89. data/lib/social_stream/models/{actor.rb → subject.rb} +10 -30
  90. data/lib/social_stream/models/supertype.rb +5 -2
  91. data/lib/social_stream/rails.rb +25 -6
  92. data/lib/social_stream/relations.rb +46 -0
  93. data/lib/social_stream/version.rb +1 -1
  94. data/lib/social_stream.rb +13 -13
  95. data/lib/tasks/db/populate.rake +23 -29
  96. data/spec/controllers/groups_controller_spec.rb +2 -6
  97. data/spec/controllers/ties_controller_spec.rb +19 -0
  98. data/spec/controllers/users_controller_spec.rb +0 -2
  99. data/spec/dummy/config/application.rb +0 -1
  100. data/spec/dummy/config/initializers/social_stream.rb +14 -2
  101. data/spec/dummy/config/relations.yml +42 -0
  102. data/spec/dummy/db/schema.rb +9 -0
  103. data/spec/dummy/db/seeds.rb +0 -1
  104. data/spec/factories/activity.rb +2 -2
  105. data/spec/factories/actor.rb +2 -1
  106. data/spec/factories/group.rb +1 -0
  107. data/spec/factories/post.rb +1 -1
  108. data/spec/factories/tie.rb +16 -22
  109. data/spec/models/activity_spec.rb +27 -24
  110. data/spec/models/actor_spec.rb +3 -0
  111. data/spec/models/representation_spec.rb +16 -0
  112. data/spec/models/tie_spec.rb +49 -57
  113. data/spec/models/user_spec.rb +22 -0
  114. data/spec/support/db.rb +1 -1
  115. metadata +47 -45
  116. data/Gemfile.lock +0 -171
  117. data/app/controllers/private_messages_controller.rb +0 -3
  118. data/app/models/private_message.rb +0 -6
  119. data/app/views/groups/_follow.html.erb +0 -9
  120. data/app/views/groups/_followers.html.erb +0 -16
  121. data/app/views/home/_contacts.html.erb +0 -17
  122. data/app/views/private_messages/_messages.html.erb +0 -2
  123. data/app/views/private_messages/_private_message.html.erb +0 -17
  124. data/app/views/private_messages/edit.html.erb +0 -6
  125. data/app/views/private_messages/show.html.erb +0 -21
  126. data/app/views/ties/_pending.html.erb +0 -21
  127. data/app/views/users/_contacts.html.erb +0 -19
  128. data/init.rb +0 -3
  129. data/lib/generators/social_stream/templates/seeds.yml +0 -64
  130. data/lib/social_stream/rails/common.rb +0 -36
  131. data/lib/social_stream/rails/engine.rb +0 -9
  132. data/lib/social_stream/rails/railtie.rb +0 -9
  133. data/lib/social_stream/seed.rb +0 -49
  134. data/spec/dummy/db/seeds/social_stream.yml +0 -64
  135. data/spec/models/user_space.rb +0 -10
@@ -11,9 +11,13 @@
11
11
  <br class="clearfloat" />
12
12
  <div class="space_center">
13
13
  </div>
14
+
15
+ <% if current_subject.respond_to?(:recent_groups) %>
14
16
  <div id="my_groups">
15
17
  <%= render :partial => "groups" %>
16
18
  </div>
19
+ <% end %>
20
+
17
21
  <%= render :partial => "activities/activities",
18
- :locals => { :activities => current_user.wall.paginate,
19
- :owner => current_user } %>
22
+ :locals => { :activities => current_subject.home_wall.paginate,
23
+ :owner => current_subject } %>
@@ -2,7 +2,7 @@
2
2
  <div id="footer">
3
3
  <ul>
4
4
  <li>2010 © </li>
5
- <li id="trade_mark"><%= link_to t('socialstream'), 'http://social_stream.dit.upm.es/' %></li>
5
+ <li id="trade_mark"><%= link_to t('socialstream'), 'http://social-stream.dit.upm.es/' %></li>
6
6
  </ul>
7
7
  </div>
8
8
  </div>
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  <%=image_tag("btn/btn_profile.png",:class=>"btn_config") %>
14
14
  <div class="txt_config">
15
- <%= link_to(t('profile.one'), current_user)%>
15
+ <%= link_to(t('profile.one'), current_subject)%>
16
16
  </div>
17
17
  <%=image_tag("btn/btn_browse.png",:class=>"btn_config") %>
18
18
  <div class="txt_config2">
@@ -24,6 +24,9 @@
24
24
  <div class="txt_config">
25
25
  <%= t('account.one') %>
26
26
  </div>
27
+
28
+ <%= render :partial => 'layouts/representation' %>
29
+
27
30
  <%=image_tag("btn/btn_exit.png",:class=>"btn_config") %>
28
31
  <div class="txt_config2">
29
32
  <%= link_to t('sign_out_user', :user => current_user.name), destroy_user_session_path %>
@@ -0,0 +1,20 @@
1
+ <%= link_to(image_tag(current_user.logo.url(:tie)), current_user) %>
2
+
3
+ <div class="txt_config">
4
+ <%= link_to(current_user.name, current_user) %>
5
+
6
+ <%= t('representation.action') %>
7
+
8
+ <%= form_for(Representation.new(current_subject), :url => representation_path) do |f| %>
9
+ <%= f.select :subject_dom_id, current_user.represented.unshift(current_user).map{ |s| [ s.name, dom_id(s) ] } %>
10
+ <%= f.submit t('representation.change') %>
11
+ <% end %>
12
+ </div>
13
+
14
+ <%-# this should be in content_for(:javascript), but the partial is rendered after yield(:javascript) -%>
15
+ <script type="text/javascript" charset="utf-8">
16
+ $("#representation_submit").hide();
17
+ $("#representation_subject_dom_id").change(function() {
18
+ $(this).closest("form").submit();
19
+ });
20
+ </script>
@@ -1,10 +1,10 @@
1
- <%= form_for(@private_message) do |f| %>
2
- <% if @private_message.errors.any? %>
1
+ <%= form_for(@message) do |f| %>
2
+ <% if @message.errors.any? %>
3
3
  <div id="error_explanation">
4
- <h2><%= pluralize(@private_message.errors.count, "error") %> prohibited this private_message from being saved:</h2>
4
+ <h2><%= pluralize(@message.errors.count, "error") %> prohibited this message from being saved:</h2>
5
5
 
6
6
  <ul>
7
- <% @private_message.errors.full_messages.each do |msg| %>
7
+ <% @message.errors.full_messages.each do |msg| %>
8
8
  <li><%= msg %></li>
9
9
  <% end %>
10
10
  </ul>
@@ -12,7 +12,7 @@
12
12
  <div class="space_center">
13
13
  </div>
14
14
 
15
- <div id="new_message" ><%= link_to 'New Message', new_private_message_path %></div>
15
+ <div id="new_message" ><%= link_to 'New Message', new_message_path %></div>
16
16
  <div class="space_center">
17
17
  </div>
18
18
  <div class="space_center">
@@ -1,3 +1,3 @@
1
1
  <div id="map_location" class="content_size">
2
- <%= t('location.message', :location => "#{ image_tag('btn/btn_inbox.png' , :class => 'btn_config') } #{ t('inbox.one') }: <span class=\"name_group\">#{ sanitize current_user.name }</span>").html_safe %>
2
+ <%= t('location.message', :location => "#{ image_tag('btn/btn_inbox.png' , :class => 'btn_config') } #{ t('inbox.one') }: <span class=\"name_group\">#{ sanitize current_subject.name }</span>").html_safe %>
3
3
  </div>
@@ -0,0 +1,17 @@
1
+ <%= div_for (message) do %>
2
+ <div class="actor_logo">
3
+ <%= link_to image_tag(message.text,
4
+ :alt => message.text),
5
+ message %>
6
+ </div>
7
+ <div class="activity_content_message">
8
+ <div class="actor_name_message">
9
+ <%= link_to(message.text, message) %>
10
+ </div>
11
+ <div class="option_msg">
12
+ <div class="edit_message"><%= link_to ( image_tag('btn/btn_edit.png', :class=>"btn_config"), edit_message_path(message)) %></div>
13
+ <div class="detele_message"><%= link_to ( image_tag('btn/btn_delete.png', :class=>"btn_config"), message, :confirm => 'Are you sure?', :method => :delete) %></div>
14
+ </div>
15
+ </div>
16
+
17
+ <% end %>
@@ -0,0 +1,2 @@
1
+ <% content_for :head, stylesheet_link_tag("message", :media => "screen, projection") %>
2
+ <%= render @messages %>
@@ -0,0 +1,6 @@
1
+ <h1>Editing message</h1>
2
+
3
+ <%= render 'form' %>
4
+
5
+ <%= link_to 'Show', @message %> |
6
+ <%= link_to 'Back', messages_path %>
@@ -7,8 +7,8 @@
7
7
  <% end %>
8
8
 
9
9
 
10
- <h1>New private_message</h1>
10
+ <h1>New message</h1>
11
11
 
12
12
  <%= render 'form' %>
13
13
 
14
- <%= link_to 'Back', private_messages_path %>
14
+ <%= link_to 'Back', messages_path %>
@@ -0,0 +1,21 @@
1
+
2
+ <p id="notice"><%= notice %></p>
3
+
4
+ <p>
5
+ <b>Sender:</b>
6
+ <%= @message.sender %>
7
+ </p>
8
+
9
+ <p>
10
+ <b>Receiver:</b>
11
+ <%= @message.receiver %>
12
+ </p>
13
+
14
+ <p>
15
+ <b>Text:</b>
16
+ <%= @message.text %>
17
+ </p>
18
+
19
+
20
+ <%= link_to 'Edit', edit_message_path(@message) %> |
21
+ <%= link_to 'Back', messages_path %>
@@ -0,0 +1,20 @@
1
+ <% if (cs = subject.subjects(:direction => :receivers)).present? %>
2
+
3
+ <div class="contacts_header">
4
+ <%=image_tag("btn/btn_friend.png", :class => "contacts_icon")%>
5
+ <div class="contacts_text_header">
6
+ <%= cs.count %> <%= t('contact', :count => cs.count) %>
7
+ </div>
8
+ </div>
9
+ <div class ="contacts">
10
+ <div class="contact">
11
+ <% cs.each do |contact| %>
12
+ <%= link_to(image_tag(contact.logo.url, :alt => contact.name , :size => "40x40"), contact) %>
13
+ <% end %>
14
+ </div>
15
+ </div>
16
+ <div class="contacts_footer">
17
+ <%=link_to(image_tag("btn/btn_next.png", :alt => "next"), '#') %>
18
+ </div>
19
+
20
+ <% end %>
@@ -7,17 +7,17 @@
7
7
  @tie.receiver_subject %>
8
8
  </div>
9
9
  <div class="activity_add_ties">
10
- <div><%= t('message')+":" %><br />
10
+ <div><%= t('message.one')+":" %><br />
11
11
  <%= form_for @tie,
12
12
  :remote => true do |f| %>
13
13
  <%= f.hidden_field :receiver_id %>
14
14
  <%= f.hidden_field :sender_id %>
15
- <%= f.hidden_field :relation_name %>
16
- <% if @tie.relation!.granted %>
17
- <%= f.text_area :message, :class =>"input_new_tie" %>
18
- <% end %>
15
+ <%= f.text_area :message, :class =>"input_new_tie" %>
16
+
17
+ <%= f.select :relation_name, @tie.sender.relations.sort.map{ |r| [ r.name, r.name ] } %>
18
+
19
19
  <div class="ties_btn">
20
- <%= submit_tag t('send', :scope => @tie.relation_name), :class => "tie_btn" %>
20
+ <%= submit_tag t('contact.new.submit'), :class => "tie_btn" %>
21
21
  </div>
22
22
  <% end %>
23
23
  </div>
@@ -1,14 +1,14 @@
1
- <% if current_user.pending_ties.any? %>
1
+ <% if current_subject.pending_ties.any? %>
2
2
  <div class="middle_box">
3
3
  <div class="middle_box_header">
4
- <%= image_tag('notifications.png', :class => "middle_box_picture_icon") %>
4
+ <%= image_tag('btn/btn_notifications.png', :class => "middle_box_picture_icon") %>
5
5
  <div class="middle_box_text_header"><%= t 'tie.pending.other' %></div>
6
6
  <div class="title_righ">
7
7
  <a href="#"><%= t 'tie.pending.all' %></a>
8
8
  </div>
9
9
  </div>
10
10
 
11
- <%= render current_user.pending_ties %>
11
+ <%= render current_subject.pending_ties %>
12
12
 
13
13
  </div>
14
14
  <% end -%>
@@ -1,4 +1,4 @@
1
- <% if current_user.suggestion.present? %>
1
+ <% if current_subject.suggestion.present? %>
2
2
  <% content_for :javascript do %>
3
3
 
4
4
  $(".suggestions .tie_close").livequery("click",function(){
@@ -19,8 +19,8 @@
19
19
  </div>
20
20
  </div>
21
21
  <div class="suggestions">
22
- <% if (sgs = current_user.suggestions(2)).present? %>
22
+ <% if (sgs = current_subject.suggestions(2)).present? %>
23
23
  <%= render sgs %>
24
24
  <%end%>
25
25
  </div>
26
- <%end%>
26
+ <%end%>
@@ -11,7 +11,7 @@
11
11
  <%= tie_brief(tie.receiver_subject) %>
12
12
  </div>
13
13
  <div class="tie_link" id="tie_link<%= dom_id(tie.receiver_subject)%>">
14
- <%= tie_link(tie) %>
14
+ <%= new_tie_link(tie) %>
15
15
  </div>
16
16
  </div>
17
17
  <div class="tie_close"><%=link_to('X','#')%></div>
@@ -3,14 +3,14 @@
3
3
  <% else %>
4
4
  var old_tie = $("#tie_<%= dom_id(@tie.receiver_subject) %>");
5
5
  var link_tie = $("#tie_link<%= dom_id(@tie.receiver_subject) %>");
6
- <% if @tie.receiver_subject.is_a?(Group) && ! @tie.relation.granted #group follower %>
6
+ <% if @tie.receiver_subject.is_a?(Group) #group tie %>
7
7
  // add to group list
8
8
  if ($('#carousel_ul').length) { // element found
9
9
  $("#carousel_ul").prepend("<%= escape_javascript(render @tie.receiver_subject) %>");
10
10
  }else{ // no element found
11
11
  $("#my_groups").html("<%= escape_javascript(render 'users/groups' )%>");
12
12
  }
13
- $("#group_count").html("<%=current_user.recent_groups.count%>");
13
+ $("#group_count").html("<%=current_subject.recent_groups.count%>");
14
14
  link_tie.replaceWith("<%= escape_javascript(link_follow_state) %>");
15
15
  link_tie.slideUp(300).delay(800).fadeIn(400);
16
16
  <% else %>
@@ -20,8 +20,7 @@
20
20
  } else {
21
21
  old_tie.hide();
22
22
  }
23
- <% if @tie.relation.granted # There was boxy dialog %>
24
- $(".boxy-inner .close").click();
25
- <% end %>
23
+
24
+ $(".boxy-inner .close").click();
26
25
  <% end %>
27
26
  <% end %>
@@ -1,2 +1,2 @@
1
1
  new Boxy("<%= escape_javascript(render(:partial => "ties/new")) %>",
2
- { title: "<%= escape_javascript(t('confirm_new', :name => @tie.receiver_subject.name , :scope => @tie.relation_name)) %>" });
2
+ { title: "<%= escape_javascript(t('contact.new.title', :name => @tie.receiver_subject.name )) %>" });
@@ -1,9 +1,9 @@
1
- <% if current_user.recent_groups.any? %>
1
+ <% if user.recent_groups.any? %>
2
2
  <div id="groups_title" class="content_size">
3
- <%=t('group.one', :count => current_user.recent_groups.count) %> (<span id="group_count"><%=current_user.recent_groups.count%></span>)
3
+ <%=t('group.one', :count => user.recent_groups.count) %> (<span id="group_count"><%=user.recent_groups.count%></span>)
4
4
  </div>
5
5
  <div id="groups_list" class="content_size">
6
- <% if (current_user.recent_groups.count) > 10 %>
6
+ <% if (user.recent_groups.count) > 10 %>
7
7
  <div id='carousel_container'>
8
8
  <div id='left_scroll'><%=image_tag("btn/group_left.png")%></div>
9
9
  <div id='carousel_inner'>
@@ -11,8 +11,8 @@
11
11
  <% else %>
12
12
  <div class="space_center"></div>
13
13
  <%end%>
14
- <%= render current_user.recent_groups %>
15
- <% if (current_user.recent_groups.count) > 10 %>
14
+ <%= render user.recent_groups %>
15
+ <% if (user.recent_groups.count) > 10 %>
16
16
  </ul>
17
17
  </div>
18
18
  <div id='right_scroll'><%=image_tag("btn/group_right.png")%></div>
@@ -11,7 +11,9 @@
11
11
  <div class="post_picture"><%= link_to (image_tag(user.logo.url , :size => "50x50", :alt => user.name )),user %></div>
12
12
  <div class="post_browse_content_people content_size">
13
13
  <div class="post_browse_title content_size" ><%=link_to(user.name, user)%></div>
14
- <div class="content_size">+ <a href="#">Add as contact</a></div>
14
+ <div class="content_size">
15
+ <%= ties_to(user) %>
16
+ </div>
15
17
  </div>
16
18
  </div>
17
19
 
@@ -1,5 +1,5 @@
1
1
  <ul class="menu noaccordion">
2
2
  <li>
3
- <%= link_to( image_tag("btn/btn_inbox.png", :class => "menu_icon")+t('inbox.one'), current_user) %>
3
+ <%= link_to( image_tag("btn/btn_inbox.png", :class => "menu_icon")+t('inbox.one'), '#') %>
4
4
  </li>
5
5
  </ul>
@@ -4,9 +4,9 @@
4
4
  <%= render :partial => 'menu' %>
5
5
  <div class="space_center">
6
6
  </div>
7
- <% if @user.friends.count>0 %>
8
- <%= render :partial => "contacts" %>
9
- <%end%>
7
+
8
+ <%= render :partial => 'subjects/contacts', :locals => { :subject => @user } %>
9
+
10
10
  <div class="space_center">
11
11
  </div>
12
12
  <div class="space_center">
@@ -12,7 +12,9 @@
12
12
  <div class="space_center">
13
13
  </div>
14
14
 
15
- <%= render :partial => "users/groups" %>
15
+ <%= render :partial => "users/groups",
16
+ :locals => { :user => @user } %>
17
+
16
18
  <%= render :partial => "activities/activities",
17
- :locals => { :activities => @user.wall_profile(current_user).paginate,
18
- :owner => @user } %>
19
+ :locals => { :activities => @user.profile_wall(current_subject).paginate,
20
+ :owner => @user } %>
@@ -15,28 +15,18 @@ en:
15
15
  comment:
16
16
  input: "Write a comment..."
17
17
  confirm_delete: "Delete comment?"
18
+ contact:
19
+ one: "Contact"
20
+ other: "Contacts"
21
+ new:
22
+ link: "+ Add contact"
23
+ title: "Add %{name} as contact"
24
+ submit: "+ Add contact"
18
25
  copyright: "2010 Copyright - All rights reserved"
19
26
  days: Days
20
27
  delete:
21
28
  confirm: Delete %{element}}?
22
- follow: "Follow"
23
- follower:
24
- one: Follower
25
- other: Followers
26
- new: "+ Follow"
27
- confirm_new: "Do you want to follow %{name}?"
28
- submit: "+ Follow"
29
29
  forgot_password?: "Forgot you password?"
30
- friend:
31
- one: Friend
32
- other: Friends
33
- my: "My Friends"
34
- add: Add as Friend
35
- submit: "Accept as friend"
36
- friend_request:
37
- new: "+ Add as friend"
38
- send: "Send Request"
39
- confirm_new: "Do you want to add %{name} as friend?"
40
30
  frontpage:
41
31
  collaborate:
42
32
  sentence1: "Organize your projects and activities"
@@ -48,7 +38,7 @@ en:
48
38
  participants: "Participants"
49
39
  groups: "Groups"
50
40
  tags: "Tags"
51
- main_title: "SocialStream a core for building social network applications."
41
+ main_title: "SocialStream is a core for building social network websites."
52
42
  meet:
53
43
  sentence1: "Meet interesting people and groups"
54
44
  share:
@@ -72,7 +62,8 @@ en:
72
62
  one: "Inbox"
73
63
  location:
74
64
  message: "You are here > %{location}"
75
- message: "Message"
65
+ message:
66
+ one: "Message"
76
67
  menu:
77
68
  options: "Menu Options"
78
69
  post:
@@ -81,6 +72,9 @@ en:
81
72
  one: "Profile"
82
73
  public:
83
74
  other: "Everybody"
75
+ representation:
76
+ action: "representing"
77
+ change: "Change"
84
78
  sign_in: "Sign in"
85
79
  sign_up: "Sign up"
86
80
  sign_out_user: "Sign out (%{user})"
data/config/routes.rb CHANGED
@@ -1,10 +1,15 @@
1
1
  Rails.application.routes.draw do
2
- devise_for :users
3
- resources :users
2
+
3
+ root :to => "frontpage#index"
4
4
 
5
5
  match 'home' => 'home#index', :as => :home
6
6
  match 'home' => 'home#index', :as => :user_root # devise after_sign_in_path_for
7
7
 
8
+ devise_for :users
9
+ resources :users
10
+
11
+ resource :representation
12
+
8
13
  resources :groups
9
14
 
10
15
  resources :ties do
@@ -12,12 +17,14 @@ Rails.application.routes.draw do
12
17
  get 'suggestion'
13
18
  end
14
19
  end
20
+
15
21
  resources :activities do
16
22
  resource :like
17
23
  end
24
+
25
+
18
26
  resources :posts
19
27
  resources :comments
20
- resources :private_messages
28
+ resources :messages
21
29
 
22
- root :to => "frontpage#index"
23
30
  end
@@ -10,8 +10,8 @@ class SocialStream::InstallGenerator < Rails::Generators::Base #:nodoc:
10
10
  copy_file 'initializer.rb', 'config/initializers/social_stream.rb'
11
11
  end
12
12
 
13
- def create_config_file
14
- copy_file 'seeds.yml', 'db/seeds/social_stream.yml'
13
+ def create_config_relations_file
14
+ copy_file 'relations.yml', 'config/relations.yml'
15
15
  end
16
16
 
17
17
  def copy_public
@@ -28,14 +28,6 @@ class SocialStream::InstallGenerator < Rails::Generators::Base #:nodoc:
28
28
  'app/views/layouts/application.html.erb'
29
29
  end
30
30
 
31
- def create_seed_code
32
- seed_code = "\nSocialStream.seed!"
33
-
34
- in_root do
35
- append_file 'db/seeds.rb', seed_code
36
- end
37
- end
38
-
39
31
  # TODO: hook_for :orm
40
32
  require 'rails/generators/active_record'
41
33
 
@@ -13,5 +13,5 @@ SocialStream.setup do |config|
13
13
  # Type of activities managed by actors
14
14
  # Remember you must add an "activity_object_id" foreign key column to your migration!
15
15
  #
16
- # config.activity_objects = [ :post, :comment ]
16
+ # config.activity_objects = [ :post, :comment, :messages ]
17
17
  end
@@ -67,10 +67,19 @@ class CreateSocialStream < ActiveRecord::Migration
67
67
 
68
68
  add_index "groups", "actor_id"
69
69
 
70
+ create_table "messages", :force => true do |t|
71
+ t.integer "activity_object_id"
72
+ t.datetime "created_at"
73
+ t.datetime "updated_at"
74
+ t.text "text"
75
+ end
76
+
77
+ add_index "messages", "activity_object_id"
78
+
70
79
  create_table "permissions", :force => true do |t|
71
80
  t.string "action"
72
81
  t.string "object"
73
- t.string "parameter"
82
+ t.string "function"
74
83
  t.datetime "created_at"
75
84
  t.datetime "updated_at"
76
85
  end
@@ -84,19 +93,8 @@ class CreateSocialStream < ActiveRecord::Migration
84
93
 
85
94
  add_index "posts", "activity_object_id"
86
95
 
87
- create_table "private_messages", :force => true do |t|
88
- t.integer "sender_id"
89
- t.integer "receiver_id"
90
- t.datetime "created_at"
91
- t.datetime "updated_at"
92
- t.text "text"
93
- end
94
-
95
- add_index "private_messages", "sender_id"
96
- add_index "private_messages", "receiver_id"
97
-
98
96
  create_table "profiles", :force => true do |t|
99
- t.integer "user_id"
97
+ t.integer "actor_id"
100
98
  t.date "birthday"
101
99
  t.datetime "created_at"
102
100
  t.datetime "updated_at"
@@ -117,7 +115,7 @@ class CreateSocialStream < ActiveRecord::Migration
117
115
  t.string "im", :limit => 45
118
116
  end
119
117
 
120
- add_index "profiles", "user_id"
118
+ add_index "profiles", "actor_id"
121
119
 
122
120
  create_table "relation_permissions", :force => true do |t|
123
121
  t.integer "relation_id"
@@ -139,9 +137,6 @@ class CreateSocialStream < ActiveRecord::Migration
139
137
  t.integer "parent_id"
140
138
  t.integer "lft"
141
139
  t.integer "rgt"
142
- t.integer "inverse_id"
143
- t.integer "granted_id"
144
- t.boolean "reflexive", :default => false
145
140
  end
146
141
 
147
142
  add_index "relations", "parent_id"
@@ -164,7 +159,6 @@ class CreateSocialStream < ActiveRecord::Migration
164
159
  t.integer "tie_id"
165
160
  t.integer "activity_id"
166
161
  t.boolean "read"
167
- t.boolean "deleted"
168
162
  t.boolean "original", :default => true
169
163
  end
170
164
 
@@ -177,7 +171,6 @@ class CreateSocialStream < ActiveRecord::Migration
177
171
  t.integer "relation_id"
178
172
  t.datetime "created_at"
179
173
  t.datetime "updated_at"
180
- t.text "message"
181
174
  end
182
175
 
183
176
  add_index "ties", "receiver_id"
@@ -198,8 +191,6 @@ class CreateSocialStream < ActiveRecord::Migration
198
191
 
199
192
  t.timestamps
200
193
  t.integer "actor_id"
201
- # FIXME: move to profile
202
- t.date "birthday"
203
194
  end
204
195
 
205
196
  add_index "users", "actor_id"
@@ -218,9 +209,11 @@ class CreateSocialStream < ActiveRecord::Migration
218
209
 
219
210
  add_foreign_key "groups", "actors", :name => "groups_on_actor_id"
220
211
 
212
+ add_foreign_key "messages", "activity_objects", :name => "messages_on_activity_object_id"
213
+
221
214
  add_foreign_key "posts", "activity_objects", :name => "posts_on_activity_object_id"
222
215
 
223
- add_foreign_key "profiles", "users", :name => "profiles_on_user_id"
216
+ add_foreign_key "profiles", "actors", :name => "profiles_on_actor_id"
224
217
 
225
218
  add_foreign_key "relation_permissions", "relations", :name => "relation_permissions_on_relation_id"
226
219
  add_foreign_key "relation_permissions", "permissions", :name => "relation_permissions_on_permission_id"
@@ -250,9 +243,11 @@ class CreateSocialStream < ActiveRecord::Migration
250
243
 
251
244
  remove_foreign_key "groups", :name => "groups_on_actor_id"
252
245
 
246
+ remove_foreign_key "messages", :name => "messages_on_activity_object_id"
247
+
253
248
  remove_foreign_key "posts", :name => "posts_on_activity_object_id"
254
249
 
255
- remove_foreign_key "profiles", :name => "profiles_on_user_id"
250
+ remove_foreign_key "profiles", :name => "profiles_on_actor_id"
256
251
 
257
252
  remove_foreign_key "relation_permissions", :name => "relation_permissions_on_relation_id"
258
253
  remove_foreign_key "relation_permissions", :name => "relation_permissions_on_permission_id"
@@ -276,9 +271,9 @@ class CreateSocialStream < ActiveRecord::Migration
276
271
  drop_table :actors
277
272
  drop_table :comments
278
273
  drop_table :groups
274
+ drop_table :messages
279
275
  drop_table :permissions
280
276
  drop_table :posts
281
- drop_table :private_messages
282
277
  drop_table :profiles
283
278
  drop_table :relation_permissions
284
279
  drop_table :relations