social_stream-base 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (259) hide show
  1. data/app/assets/images/cleditor/buttons.gif +0 -0
  2. data/app/assets/images/cleditor/toolbar.gif +0 -0
  3. data/app/assets/javascripts/conversations.js +1 -1
  4. data/app/assets/javascripts/messages.js +1 -1
  5. data/app/assets/stylesheets/conversations.css +1 -0
  6. data/app/assets/stylesheets/messages.css +1 -0
  7. data/app/controllers/groups_controller.rb +6 -0
  8. data/app/controllers/users_controller.rb +6 -0
  9. data/app/helpers/contacts_helper.rb +8 -10
  10. data/app/helpers/profiles_helper.rb +6 -0
  11. data/app/models/activity.rb +2 -0
  12. data/app/models/activity_object.rb +3 -3
  13. data/app/models/actor.rb +24 -43
  14. data/app/models/contact.rb +23 -10
  15. data/app/views/contacts/_contact.html.erb +1 -1
  16. data/app/views/contacts/_pendings.html.erb +2 -2
  17. data/app/views/contacts/_suggestions.html.erb +2 -4
  18. data/app/views/contacts/destroy.js.erb +1 -1
  19. data/app/views/conversations/show.html.erb +6 -17
  20. data/app/views/conversations/show.js.erb +16 -27
  21. data/app/views/messages/_new.html.erb +1 -4
  22. data/app/views/messages/new.html.erb +10 -22
  23. data/app/views/messages/new.js.erb +9 -16
  24. data/app/views/profiles/_contact.html.erb +1 -1
  25. data/config/locales/en.yml +4 -1
  26. data/lib/social_stream/base/version.rb +1 -1
  27. data/lib/social_stream/models/supertype.rb +9 -7
  28. data/lib/social_stream/toolbar_config.rb +5 -5
  29. data/social_stream-base.gemspec +1 -1
  30. data/spec/controllers/relation_customs_controller_spec.rb +2 -1
  31. data/spec/factories/relation_custom.rb +1 -1
  32. data/spec/models/actor_spec.rb +5 -5
  33. data/spec/models/tie_spec.rb +17 -0
  34. data/vendor/assets/javascripts/jquery.cleditor.min.js +31 -0
  35. data/vendor/assets/stylesheets/jquery.cleditor.css +24 -0
  36. metadata +10 -229
  37. data/app/assets/javascripts/ckeditor.rails.js.erb +0 -4
  38. data/app/views/conversations/_menu_options.html.erb +0 -19
  39. data/spec/factories/actor.rb +0 -5
  40. data/vendor/assets/javascripts/ckeditor/.htaccess +0 -24
  41. data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +0 -6
  42. data/vendor/assets/javascripts/ckeditor/ckeditor.js +0 -147
  43. data/vendor/assets/javascripts/ckeditor/ckeditor_basic.js +0 -8
  44. data/vendor/assets/javascripts/ckeditor/ckeditor_basic_source.js +0 -20
  45. data/vendor/assets/javascripts/ckeditor/ckeditor_source.js +0 -25
  46. data/vendor/assets/javascripts/ckeditor/config.js +0 -23
  47. data/vendor/assets/javascripts/ckeditor/contents.css +0 -25
  48. data/vendor/assets/javascripts/ckeditor/images/spacer.gif +0 -0
  49. data/vendor/assets/javascripts/ckeditor/lang/_languages.js +0 -6
  50. data/vendor/assets/javascripts/ckeditor/lang/_translationstatus.txt +0 -61
  51. data/vendor/assets/javascripts/ckeditor/lang/af.js +0 -6
  52. data/vendor/assets/javascripts/ckeditor/lang/ar.js +0 -6
  53. data/vendor/assets/javascripts/ckeditor/lang/bg.js +0 -6
  54. data/vendor/assets/javascripts/ckeditor/lang/bn.js +0 -6
  55. data/vendor/assets/javascripts/ckeditor/lang/bs.js +0 -6
  56. data/vendor/assets/javascripts/ckeditor/lang/ca.js +0 -6
  57. data/vendor/assets/javascripts/ckeditor/lang/cs.js +0 -6
  58. data/vendor/assets/javascripts/ckeditor/lang/cy.js +0 -6
  59. data/vendor/assets/javascripts/ckeditor/lang/da.js +0 -6
  60. data/vendor/assets/javascripts/ckeditor/lang/de.js +0 -6
  61. data/vendor/assets/javascripts/ckeditor/lang/el.js +0 -6
  62. data/vendor/assets/javascripts/ckeditor/lang/en-au.js +0 -6
  63. data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +0 -6
  64. data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +0 -6
  65. data/vendor/assets/javascripts/ckeditor/lang/en.js +0 -6
  66. data/vendor/assets/javascripts/ckeditor/lang/eo.js +0 -6
  67. data/vendor/assets/javascripts/ckeditor/lang/es.js +0 -6
  68. data/vendor/assets/javascripts/ckeditor/lang/et.js +0 -6
  69. data/vendor/assets/javascripts/ckeditor/lang/eu.js +0 -6
  70. data/vendor/assets/javascripts/ckeditor/lang/fa.js +0 -6
  71. data/vendor/assets/javascripts/ckeditor/lang/fi.js +0 -6
  72. data/vendor/assets/javascripts/ckeditor/lang/fo.js +0 -6
  73. data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +0 -6
  74. data/vendor/assets/javascripts/ckeditor/lang/fr.js +0 -6
  75. data/vendor/assets/javascripts/ckeditor/lang/gl.js +0 -6
  76. data/vendor/assets/javascripts/ckeditor/lang/gu.js +0 -6
  77. data/vendor/assets/javascripts/ckeditor/lang/he.js +0 -6
  78. data/vendor/assets/javascripts/ckeditor/lang/hi.js +0 -6
  79. data/vendor/assets/javascripts/ckeditor/lang/hr.js +0 -6
  80. data/vendor/assets/javascripts/ckeditor/lang/hu.js +0 -6
  81. data/vendor/assets/javascripts/ckeditor/lang/is.js +0 -6
  82. data/vendor/assets/javascripts/ckeditor/lang/it.js +0 -6
  83. data/vendor/assets/javascripts/ckeditor/lang/ja.js +0 -6
  84. data/vendor/assets/javascripts/ckeditor/lang/ka.js +0 -6
  85. data/vendor/assets/javascripts/ckeditor/lang/km.js +0 -6
  86. data/vendor/assets/javascripts/ckeditor/lang/ko.js +0 -6
  87. data/vendor/assets/javascripts/ckeditor/lang/lt.js +0 -6
  88. data/vendor/assets/javascripts/ckeditor/lang/lv.js +0 -6
  89. data/vendor/assets/javascripts/ckeditor/lang/mn.js +0 -6
  90. data/vendor/assets/javascripts/ckeditor/lang/ms.js +0 -6
  91. data/vendor/assets/javascripts/ckeditor/lang/nb.js +0 -6
  92. data/vendor/assets/javascripts/ckeditor/lang/nl.js +0 -6
  93. data/vendor/assets/javascripts/ckeditor/lang/no.js +0 -6
  94. data/vendor/assets/javascripts/ckeditor/lang/pl.js +0 -6
  95. data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +0 -6
  96. data/vendor/assets/javascripts/ckeditor/lang/pt.js +0 -6
  97. data/vendor/assets/javascripts/ckeditor/lang/ro.js +0 -6
  98. data/vendor/assets/javascripts/ckeditor/lang/ru.js +0 -6
  99. data/vendor/assets/javascripts/ckeditor/lang/sk.js +0 -6
  100. data/vendor/assets/javascripts/ckeditor/lang/sl.js +0 -6
  101. data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +0 -6
  102. data/vendor/assets/javascripts/ckeditor/lang/sr.js +0 -6
  103. data/vendor/assets/javascripts/ckeditor/lang/sv.js +0 -6
  104. data/vendor/assets/javascripts/ckeditor/lang/th.js +0 -6
  105. data/vendor/assets/javascripts/ckeditor/lang/tr.js +0 -6
  106. data/vendor/assets/javascripts/ckeditor/lang/uk.js +0 -6
  107. data/vendor/assets/javascripts/ckeditor/lang/vi.js +0 -6
  108. data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +0 -6
  109. data/vendor/assets/javascripts/ckeditor/lang/zh.js +0 -6
  110. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +0 -7
  111. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/en.js +0 -6
  112. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/he.js +0 -6
  113. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +0 -6
  114. data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  115. data/vendor/assets/javascripts/ckeditor/plugins/adobeair/plugin.js +0 -6
  116. data/vendor/assets/javascripts/ckeditor/plugins/ajax/plugin.js +0 -6
  117. data/vendor/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +0 -6
  118. data/vendor/assets/javascripts/ckeditor/plugins/bbcode/plugin.js +0 -9
  119. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -7
  120. data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +0 -7
  121. data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/en.js +0 -6
  122. data/vendor/assets/javascripts/ckeditor/plugins/devtools/plugin.js +0 -6
  123. data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +0 -4
  124. data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +0 -8
  125. data/vendor/assets/javascripts/ckeditor/plugins/docprops/dialogs/docprops.js +0 -10
  126. data/vendor/assets/javascripts/ckeditor/plugins/docprops/plugin.js +0 -6
  127. data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +0 -10
  128. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +0 -9
  129. data/vendor/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png +0 -0
  130. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +0 -6
  131. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +0 -6
  132. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +0 -6
  133. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +0 -6
  134. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +0 -6
  135. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +0 -9
  136. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +0 -6
  137. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +0 -6
  138. data/vendor/assets/javascripts/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
  139. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +0 -7
  140. data/vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
  141. data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -6
  142. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +0 -13
  143. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +0 -6
  144. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +0 -12
  145. data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.gif +0 -0
  146. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +0 -7
  147. data/vendor/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
  148. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +0 -11
  149. data/vendor/assets/javascripts/ckeditor/plugins/pastetext/dialogs/pastetext.js +0 -6
  150. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +0 -6
  151. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +0 -6
  152. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +0 -6
  153. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/placeholder.gif +0 -0
  154. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +0 -6
  155. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +0 -8
  156. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -6
  157. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
  158. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
  159. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
  160. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
  161. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
  162. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
  163. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
  164. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
  165. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
  166. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
  167. data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
  168. data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +0 -7
  169. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
  170. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
  171. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
  172. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
  173. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
  174. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
  175. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
  176. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif +0 -0
  177. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif +0 -0
  178. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif +0 -0
  179. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
  180. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
  181. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
  182. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
  183. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
  184. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
  185. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
  186. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
  187. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
  188. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  189. data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
  190. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +0 -7
  191. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/en.js +0 -6
  192. data/vendor/assets/javascripts/ckeditor/plugins/styles/styles/default.js +0 -6
  193. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +0 -6
  194. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +0 -9
  195. data/vendor/assets/javascripts/ckeditor/plugins/tableresize/plugin.js +0 -7
  196. data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +0 -8
  197. data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +0 -7
  198. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +0 -6
  199. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  200. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  201. data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  202. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/dialogs/uicolor.js +0 -7
  203. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/en.js +0 -6
  204. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/he.js +0 -6
  205. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/plugin.js +0 -6
  206. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/uicolor.gif +0 -0
  207. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
  208. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
  209. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
  210. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
  211. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css +0 -6
  212. data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/yui.js +0 -76
  213. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -49
  214. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -52
  215. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +0 -6
  216. data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +0 -7
  217. data/vendor/assets/javascripts/ckeditor/plugins/xml/plugin.js +0 -6
  218. data/vendor/assets/javascripts/ckeditor/skins/kama/dialog.css +0 -10
  219. data/vendor/assets/javascripts/ckeditor/skins/kama/editor.css +0 -13
  220. data/vendor/assets/javascripts/ckeditor/skins/kama/icons.png +0 -0
  221. data/vendor/assets/javascripts/ckeditor/skins/kama/icons_rtl.png +0 -0
  222. data/vendor/assets/javascripts/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
  223. data/vendor/assets/javascripts/ckeditor/skins/kama/images/dialog_sides.png +0 -0
  224. data/vendor/assets/javascripts/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
  225. data/vendor/assets/javascripts/ckeditor/skins/kama/images/mini.gif +0 -0
  226. data/vendor/assets/javascripts/ckeditor/skins/kama/images/noimage.png +0 -0
  227. data/vendor/assets/javascripts/ckeditor/skins/kama/images/sprites.png +0 -0
  228. data/vendor/assets/javascripts/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
  229. data/vendor/assets/javascripts/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
  230. data/vendor/assets/javascripts/ckeditor/skins/kama/skin.js +0 -7
  231. data/vendor/assets/javascripts/ckeditor/skins/kama/templates.css +0 -6
  232. data/vendor/assets/javascripts/ckeditor/skins/office2003/dialog.css +0 -9
  233. data/vendor/assets/javascripts/ckeditor/skins/office2003/editor.css +0 -14
  234. data/vendor/assets/javascripts/ckeditor/skins/office2003/icons.png +0 -0
  235. data/vendor/assets/javascripts/ckeditor/skins/office2003/icons_rtl.png +0 -0
  236. data/vendor/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
  237. data/vendor/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
  238. data/vendor/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
  239. data/vendor/assets/javascripts/ckeditor/skins/office2003/images/mini.gif +0 -0
  240. data/vendor/assets/javascripts/ckeditor/skins/office2003/images/noimage.png +0 -0
  241. data/vendor/assets/javascripts/ckeditor/skins/office2003/images/sprites.png +0 -0
  242. data/vendor/assets/javascripts/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
  243. data/vendor/assets/javascripts/ckeditor/skins/office2003/skin.js +0 -6
  244. data/vendor/assets/javascripts/ckeditor/skins/office2003/templates.css +0 -6
  245. data/vendor/assets/javascripts/ckeditor/skins/v2/dialog.css +0 -9
  246. data/vendor/assets/javascripts/ckeditor/skins/v2/editor.css +0 -13
  247. data/vendor/assets/javascripts/ckeditor/skins/v2/icons.png +0 -0
  248. data/vendor/assets/javascripts/ckeditor/skins/v2/icons_rtl.png +0 -0
  249. data/vendor/assets/javascripts/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
  250. data/vendor/assets/javascripts/ckeditor/skins/v2/images/dialog_sides.png +0 -0
  251. data/vendor/assets/javascripts/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
  252. data/vendor/assets/javascripts/ckeditor/skins/v2/images/mini.gif +0 -0
  253. data/vendor/assets/javascripts/ckeditor/skins/v2/images/noimage.png +0 -0
  254. data/vendor/assets/javascripts/ckeditor/skins/v2/images/sprites.png +0 -0
  255. data/vendor/assets/javascripts/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
  256. data/vendor/assets/javascripts/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
  257. data/vendor/assets/javascripts/ckeditor/skins/v2/skin.js +0 -6
  258. data/vendor/assets/javascripts/ckeditor/skins/v2/templates.css +0 -6
  259. data/vendor/assets/javascripts/ckeditor/themes/default/theme.js +0 -8
@@ -1,3 +1,3 @@
1
1
  //= require jquery.scrollTo.min
2
2
  //= require jquery.validate
3
- //= require ckeditor.rails
3
+ //= require jquery.cleditor.min
@@ -1,3 +1,3 @@
1
1
  //= require jquery.fcbkcomplete
2
2
  //= require jquery.validate
3
- //= require ckeditor.rails
3
+ //= require jquery.cleditor.min
@@ -1,3 +1,4 @@
1
1
  /*
2
2
  *= require messages
3
+ *= require jquery.cleditor
3
4
  */
@@ -1,5 +1,6 @@
1
1
  /*
2
2
  *= require fcbkComplete
3
+ *= require jquery.cleditor
3
4
  */
4
5
 
5
6
  /******************** Common ***********************/
@@ -20,6 +20,12 @@ class GroupsController < InheritedResources::Base
20
20
  end
21
21
  end
22
22
 
23
+ def show
24
+ show! do |format|
25
+ format.html { render :layout => (user_signed_in? ? 'application' : 'frontpage') }
26
+ end
27
+ end
28
+
23
29
  def create
24
30
  create! do |success, failure|
25
31
  success.html {
@@ -15,6 +15,12 @@ class UsersController < InheritedResources::Base
15
15
  end
16
16
  end
17
17
 
18
+ def show
19
+ show! do |format|
20
+ format.html { render :layout => (user_signed_in? ? 'application' : 'frontpage') }
21
+ end
22
+ end
23
+
18
24
  # Supported through devise
19
25
  def new; end; def create; end
20
26
  # Not supported yet
@@ -3,22 +3,20 @@ module ContactsHelper
3
3
  "N contacts in common"
4
4
  end
5
5
 
6
+ def contact_link(c)
7
+ link_to c.status,
8
+ edit_contact_path(c),
9
+ :title => t("contact.#{ c.action }.title", :name => c.receiver.name)
10
+
11
+ end
12
+
6
13
  # Show current ties from current user to actor, if they exist, or provide a link
7
14
  # to create new ties to actor
8
15
  def contact_to(a)
9
16
  if user_signed_in?
10
- link_to contact_status(a),
11
- edit_contact_path(current_subject.contact_to!(a)),
12
- :title => t("contact.new.title",
13
- :name => a.name)
17
+ contact_link current_subject.contact_to!(a)
14
18
  else
15
19
  link_to t("contact.new.link"), new_user_session_path
16
20
  end
17
21
  end
18
-
19
- def contact_status(a)
20
- current_subject.ties_to?(a) ?
21
- current_subject.ties_to(a).map(&:relation_name).join(", ") :
22
- t("contact.new.link")
23
- end
24
22
  end
@@ -28,4 +28,10 @@ module ProfilesHelper
28
28
  end
29
29
  end
30
30
 
31
+ #Returns the value if user is signed in or a link to sign in view
32
+ def show_if_signed_in(info)
33
+ return info if user_signed_in?
34
+ return link_to t('profile.must_be_signed_id'), new_user_session_path
35
+ end
36
+
31
37
  end
@@ -14,6 +14,8 @@
14
14
  class Activity < ActiveRecord::Base
15
15
  has_ancestry
16
16
 
17
+ paginates_per 10
18
+
17
19
  belongs_to :contact
18
20
  belongs_to :activity_verb
19
21
 
@@ -16,12 +16,12 @@ class ActivityObject < ActiveRecord::Base
16
16
 
17
17
  has_many :activity_object_activities, :dependent => :destroy
18
18
  has_many :activities, :through => :activity_object_activities
19
- has_one :actor
20
19
 
21
20
  # The object of this activity object
22
21
  def object
23
- subtype_instance ||
24
- actor.try(:subject)
22
+ subtype_instance.is_a?(Actor) ?
23
+ subtype_instance.subject :
24
+ subtype_instance
25
25
  end
26
26
 
27
27
  # The activity in which this activity_object was created
data/app/models/actor.rb CHANGED
@@ -151,8 +151,7 @@ class Actor < ActiveRecord::Base
151
151
 
152
152
  # The subject instance for this actor
153
153
  def subject
154
- subtype_instance ||
155
- activity_object.try(:object)
154
+ subtype_instance
156
155
  end
157
156
 
158
157
  # All the {Relation relations} defined by this {Actor}
@@ -233,46 +232,24 @@ class Actor < ActiveRecord::Base
233
232
  # Return a contact to subject. Create it if it does not exist
234
233
  def contact_to!(subject)
235
234
  contact_to(subject) ||
236
- sent_contacts.create!(:receiver_id => Actor.normalize_id(subject))
235
+ sent_contacts.create!(:receiver => Actor.normalize(subject))
237
236
  end
238
-
239
- # This is an scaffold for a recomendations engine
240
- #
241
-
242
- # Make n suggestions
243
- # TODO: make more
244
- def suggestions(n)
245
- n.times.map{ |m| suggestion }
237
+
238
+ def sent_active_contact_ids
239
+ sent_contacts.active.map(&:receiver_id)
246
240
  end
247
241
 
248
- # By now, it returns a tie suggesting a relation from SuggestedRelations
249
- # to another subject without any current relation
250
- #
251
- # Options::
252
- # * type: the class of the recommended subject
242
+ # By now, it returns a suggested {Contact} to another {Actor} without any current {Tie}
253
243
  #
254
244
  # @return [Contact]
255
- def suggestion(options = {})
256
- candidates_types =
257
- ( options[:type].present? ?
258
- Array(options[:type]) :
259
- self.class.subtypes )
260
-
261
- candidates_classes = candidates_types.map{ |t| t.to_s.classify.constantize }
262
-
263
- # Candidates are all the instance of "type" minus all the subjects
264
- # that are receiving any tie from this actor
265
- candidates = candidates_classes.inject([]) do |cs, klass|
266
- cs += klass.all - contact_subjects(:type => klass.to_s.underscore, :direction => :sent, :relations => relations.to_a)
267
- cs -= Array(subject) if subject.is_a?(klass)
268
- cs
269
- end
270
-
271
- candidate = candidates[rand(candidates.size)]
272
-
273
- return nil unless candidate.present?
274
-
275
- contact_to!(candidate)
245
+ def suggestions(size = 1)
246
+ candidates = Actor.where(Actor.arel_table[:id].not_in(sent_active_contact_ids + [id]))
247
+
248
+ size.times.map {
249
+ candidates.delete_at rand(candidates.size)
250
+ }.compact.map { |a|
251
+ contact_to! a
252
+ }
276
253
  end
277
254
 
278
255
  # Set of ties sent by this actor received by subject
@@ -280,15 +257,11 @@ class Actor < ActiveRecord::Base
280
257
  sent_ties.merge(Contact.received_by(subject))
281
258
  end
282
259
 
260
+ # Is there any {Tie} sent by this actor and received by subject
283
261
  def ties_to?(subject)
284
262
  ties_to(subject).present?
285
263
  end
286
264
 
287
-
288
- def ties_to?(a)
289
- ties_to(a).present?
290
- end
291
-
292
265
  # Can this actor be represented by subject. Does she has permissions for it?
293
266
  def represented_by?(subject)
294
267
  return false if subject.blank?
@@ -332,9 +305,17 @@ class Actor < ActiveRecord::Base
332
305
  Relation.allow(self, 'create', 'activity', :in => activity.relations)
333
306
  end
334
307
 
308
+ def pending_contacts_count
309
+ received_contacts.not_reflexive.pending.count
310
+ end
311
+
312
+ def pending_contacts?
313
+ pending_contacts_count > 0
314
+ end
315
+
335
316
  # Build a new {Contact} from each that has not inverse
336
317
  def pending_contacts
337
- received_contacts.not_reflexive.pending.all.map do |c|
318
+ received_contacts.not_reflexive.pending.includes(:inverse).all.map do |c|
338
319
  c.inverse ||
339
320
  c.receiver.contact_to!(c.sender)
340
321
  end
@@ -21,15 +21,15 @@ class Contact < ActiveRecord::Base
21
21
  :class_name => "Contact"
22
22
 
23
23
  belongs_to :sender,
24
- :class_name => "Actor",
25
- :include => SocialStream.subjects
24
+ :class_name => "Actor"
26
25
  belongs_to :receiver,
27
- :class_name => "Actor",
28
- :include => SocialStream.subjects
26
+ :class_name => "Actor"
29
27
 
30
28
  has_many :ties
31
29
  has_many :relations, :through => :ties
32
30
 
31
+ has_many :activities
32
+
33
33
  scope :sent_by, lambda { |a|
34
34
  where(:sender_id => Actor.normalize_id(a))
35
35
  }
@@ -78,16 +78,23 @@ class Contact < ActiveRecord::Base
78
78
  receiver.contact_to!(sender)
79
79
  end
80
80
 
81
- # Is not the inverse of this {Contact}
82
- def pending?
83
- inverse &&
81
+ # Has this {Contact} any {Tie}?
82
+ def established?
83
+ ties_count > 0
84
+ end
85
+
86
+ # The {Contact} in the other way is established
87
+ def replied?
88
+ inverse_id.present? &&
84
89
  inverse.ties_count > 0
85
90
  end
86
91
 
87
- # The {ActivityVerb} corresponding to this {Contact}, depending on if
88
- # it is pending or already replied
92
+ # The {ActivityVerb} corresponding to this {Contact}. If this contact is pending,
93
+ # the other one was establised already, so this is going to "make-friend".
94
+ # If it is not pending, the contact in the other way was not established, so this
95
+ # is following
89
96
  def verb
90
- pending? ? "follow" : "make-friend"
97
+ replied? ? "make-friend" : "follow"
91
98
  end
92
99
 
93
100
  # has_many collection=objects method does not trigger destroy callbacks,
@@ -115,6 +122,12 @@ class Contact < ActiveRecord::Base
115
122
  end
116
123
  end
117
124
 
125
+ def status
126
+ established? ?
127
+ ties.includes(:relation).map(&:relation_name).join(", ") :
128
+ I18n.t("contact.new.link")
129
+ end
130
+
118
131
  private
119
132
 
120
133
  def remove_follower(ids)
@@ -11,7 +11,7 @@
11
11
  <%= contact_brief(contact.receiver_subject) %>
12
12
  </div>
13
13
  <div class="link" id="contact_link<%= dom_id(contact.receiver_subject)%>">
14
- <%= contact_to(contact.receiver) %>
14
+ <%= contact_link(contact) %>
15
15
  </div>
16
16
  </div>
17
17
  <div class="close"><%= link_to 'X', contact, :method => :delete, :remote => true %></div>
@@ -1,4 +1,4 @@
1
- <% if current_subject.pending_contacts.any? %>
1
+ <% if current_subject.pending_contacts? %>
2
2
  <div class="block">
3
3
  <div class="header">
4
4
  <%= image_tag('btn/btn_notifications.png', :class => "header_icon") %>
@@ -9,7 +9,7 @@
9
9
  <div class="content">
10
10
  <%= render current_subject.pending_contacts.shuffle.first(2) %>
11
11
  <div class="row more_pending">
12
- <%= link_to t('contact.pending.all_n', :count => current_subject.pending_contacts.size), contacts_path(:pending=>true)%>
12
+ <%= link_to t('contact.pending.all_n', :count => current_subject.pending_contacts_count), contacts_path(:pending=>true)%>
13
13
  </div>
14
14
  <div class="space_center">
15
15
  </div>
@@ -1,4 +1,4 @@
1
- <% if current_subject.suggestion.present? %>
1
+ <% if (sgs = current_subject.suggestions(2)).present? %>
2
2
  <div class="block">
3
3
  <div class="header">
4
4
  <%= image_tag('btn/notifications.png', :class => "header_icon") %>
@@ -8,9 +8,7 @@
8
8
  </div>
9
9
  <div class="content">
10
10
  <div class="suggestions">
11
- <% if (sgs = current_subject.suggestions(2)).present? %>
12
- <%= render sgs %>
13
- <%end%>
11
+ <%= render sgs %>
14
12
  </div>
15
13
  </div>
16
14
  </div>
@@ -1,5 +1,5 @@
1
1
  <%
2
- new_contact = @contact.pending? ? current_subject.pending_contacts.last : current_subject.suggestion
2
+ new_contact = @contact.replied? ? current_subject.pending_contacts.last : current_subject.suggestions.first
3
3
  render_string = new_contact.present? ? render(new_contact) : ""
4
4
  %>
5
5
 
@@ -11,28 +11,17 @@
11
11
  <% content_for :javascript do %>
12
12
  $('.cont_conversation').validate();
13
13
  <% unless @box.eql?'trash' %>
14
- $('#body').ckeditor(
15
- function(){
16
- $('#cke_top_body').click(updateTextArea);
14
+ $("#body").cleditor({
15
+ width:493,
16
+ controls: "<%= t('cleditor.controls')%>"
17
+ });
18
+
17
19
  var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
18
20
  if (message_hash && message_hash.length > 0){
19
21
  $.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
20
22
  }else{
21
23
  $.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});
22
- }}
23
- ,{ width:525 }
24
- );
25
- var editor = $('#body').ckeditorGet();
26
- editor.on("instanceReady", function(){
27
- this.document.on("keyup", updateTextArea);
28
- this.document.on("paste", updateTextArea);
29
- this.document.on("mousedown", updateTextArea);
30
- });
31
-
32
- var updateTextArea = function (){
33
- editor.updateElement();
34
- $("#body").trigger('keyup');
35
- }
24
+ }
36
25
  <% else %>
37
26
  var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
38
27
  if (message_hash && message_hash > 0){
@@ -4,34 +4,23 @@ $("#content").html("<%= escape_javascript(render :partial => 'show') %>");
4
4
 
5
5
  $('.cont_conversation').validate();
6
6
  <% unless @box.eql?'trash' %>
7
- $('#body').ckeditor(
8
- function(){$('#cke_top_body').click( updateTextArea);
9
- var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
10
- if (message_hash && message_hash.length > 0){
11
- $.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
12
- }else{
13
- $.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});
14
- }
15
- },
16
- { width:525, customConfig:'/javascripts/ckeditor/config.js',skin:'../javascripts/ckeditor/skins/kama'}
17
- );
18
- var editor = $('#body').ckeditorGet();
19
- editor.on("instanceReady", function(){
20
- this.document.on("keyup", updateTextArea);
21
- this.document.on("paste", updateTextArea);
22
- this.document.on("mousedown", updateTextArea);
23
- }
24
- );
25
-
26
- var updateTextArea = function (){
27
- editor.updateElement();
28
- $("#body").trigger('keyup');
7
+ $("#body").cleditor({
8
+ width:493,
9
+ controls: "<%= t('cleditor.controls')%>"
10
+ });
11
+
12
+ var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
13
+ if (message_hash && message_hash.length > 0){
14
+ $.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
15
+ }else{
16
+ $.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});
29
17
  }
18
+
30
19
  <% else %>
31
20
  var message_hash = window.location.hash.match(/^.*message_(\d+).*$/);
32
- if (message_hash && message_hash.length > 0){
33
- $.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
34
- }else{
35
- $.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});
36
- }
21
+ if (message_hash && message_hash.length > 0){
22
+ $.scrollTo('#message_' + message_hash[1] ,1500,{axis:'y'});
23
+ }else{
24
+ $.scrollTo('#message_<%= @conversation.last_message.id %>',1500,{axis:'y'});
25
+ }
37
26
  <% end %>
@@ -1,7 +1,4 @@
1
- <%= location(
2
- link_to(image_tag("btn/new.png", :class => "menu_icon")+t('message.other'), conversations_path,:remote => true),
3
- link_to(image_tag("btn/message_new.png", :class => "menu_icon")+ t('message.new'), new_message_path, :remote => true)
4
- ) %>
1
+
5
2
 
6
3
  <br class="clearfloat" />
7
4
  <div class="space_center"></div>