social_stream-base 0.6.8 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (397) hide show
  1. data/.travis.yml +1 -0
  2. data/app/assets/images/btn/activity.png +0 -0
  3. data/app/assets/images/btn/post.png +0 -0
  4. data/app/assets/images/icons/favicon.ico +0 -0
  5. data/app/{views/activities/_jquery.html.erb → assets/javascripts/activities.js.erb} +24 -15
  6. data/app/assets/javascripts/ckeditor.rails.js.erb +4 -0
  7. data/app/assets/javascripts/contacts.js +10 -0
  8. data/app/assets/javascripts/conversations.js +3 -0
  9. data/app/assets/javascripts/groups.js +5 -0
  10. data/app/assets/javascripts/invitations.js +1 -0
  11. data/app/assets/javascripts/{main.js → layouts.js} +4 -11
  12. data/app/assets/javascripts/messages.js +3 -0
  13. data/app/assets/javascripts/profiles.js +6 -0
  14. data/app/{views/relation/customs/_jquery.erb → assets/javascripts/relation_customs.js} +12 -2
  15. data/app/assets/javascripts/settings.js +1 -1
  16. data/app/assets/javascripts/social_stream-base.js +6 -0
  17. data/app/assets/javascripts/toolbar.js +1 -0
  18. data/app/assets/javascripts/users.js +2 -0
  19. data/app/assets/stylesheets/base.css +18 -2
  20. data/app/controllers/contacts_controller.rb +18 -10
  21. data/app/helpers/notifications_helper.rb +13 -5
  22. data/app/models/activity.rb +14 -15
  23. data/app/models/actor.rb +7 -1
  24. data/app/models/relation.rb +1 -1
  25. data/app/models/tie.rb +1 -1
  26. data/app/views/activities/_index.html.erb +3 -9
  27. data/app/views/activities/_new.html.erb +8 -0
  28. data/app/views/contacts/_form.html.erb +0 -15
  29. data/app/views/contacts/_index.html.erb +7 -4
  30. data/app/views/contacts/index.html.erb +0 -4
  31. data/app/views/conversations/show.html.erb +0 -1
  32. data/app/views/conversations/show.js.erb +1 -3
  33. data/app/views/groups/_new.html.erb +0 -1
  34. data/app/views/groups/_sidebar_index.html.erb +0 -2
  35. data/app/views/groups/index.html.erb +0 -1
  36. data/app/views/groups/new.html.erb +0 -1
  37. data/app/views/invitation_mailer/send_invitation.html.erb +73 -65
  38. data/app/views/invitations/new.html.erb +1 -2
  39. data/app/views/layouts/_header.erb +1 -4
  40. data/app/views/layouts/application.html.erb +1 -1
  41. data/app/views/layouts/frontpage.html.erb +0 -2
  42. data/app/views/message_mailer/new_message_email.html.erb +20 -0
  43. data/app/views/message_mailer/new_message_email.text.erb +10 -0
  44. data/app/views/message_mailer/reply_message_email.html.erb +20 -0
  45. data/app/views/message_mailer/reply_message_email.text.erb +10 -0
  46. data/app/views/messages/new.html.erb +0 -1
  47. data/app/views/messages/new.js.erb +0 -2
  48. data/app/views/notification_mailer/new_notification_email.html.erb +2 -5
  49. data/app/views/notification_mailer/new_notification_email.text.erb +2 -4
  50. data/app/views/notifications/activities/_like_subject.html.erb +2 -2
  51. data/app/views/profiles/edit.html.erb +0 -8
  52. data/app/views/relation/customs/index.html.erb +0 -5
  53. data/app/views/settings/index.html.erb +1 -2
  54. data/app/views/settings/index.js.erb +0 -1
  55. data/app/views/toolbar/_home.html.erb +0 -1
  56. data/app/views/toolbar/_profile.html.erb +0 -1
  57. data/app/views/users/index.html.erb +0 -4
  58. data/config/locales/en.yml +12 -3
  59. data/lib/generators/social_stream/base/install_generator.rb +6 -0
  60. data/lib/social_stream-base.rb +2 -0
  61. data/lib/social_stream/base/version.rb +1 -1
  62. data/social_stream-base.gemspec +2 -0
  63. data/spec/controllers/posts_controller_spec.rb +19 -0
  64. data/spec/dummy/public/favicon.ico +0 -0
  65. data/spec/models/activity_authorization_spec.rb +10 -0
  66. data/spec/models/tie_spec.rb +10 -0
  67. data/{app → vendor}/assets/javascripts/ajax.paginate.js +0 -0
  68. data/{app → vendor}/assets/javascripts/ckeditor/.htaccess +0 -0
  69. data/{app → vendor}/assets/javascripts/ckeditor/adapters/jquery.js +0 -0
  70. data/vendor/assets/javascripts/ckeditor/ckeditor.js +147 -0
  71. data/vendor/assets/javascripts/ckeditor/ckeditor_basic.js +8 -0
  72. data/{app → vendor}/assets/javascripts/ckeditor/ckeditor_basic_source.js +1 -1
  73. data/{app → vendor}/assets/javascripts/ckeditor/ckeditor_source.js +1 -1
  74. data/{app → vendor}/assets/javascripts/ckeditor/config.js +0 -0
  75. data/vendor/assets/javascripts/ckeditor/contents.css +25 -0
  76. data/{app → vendor}/assets/javascripts/ckeditor/images/spacer.gif +0 -0
  77. data/{app → vendor}/assets/javascripts/ckeditor/lang/_languages.js +1 -1
  78. data/vendor/assets/javascripts/ckeditor/lang/_translationstatus.txt +61 -0
  79. data/vendor/assets/javascripts/ckeditor/lang/af.js +6 -0
  80. data/vendor/assets/javascripts/ckeditor/lang/ar.js +6 -0
  81. data/vendor/assets/javascripts/ckeditor/lang/bg.js +6 -0
  82. data/vendor/assets/javascripts/ckeditor/lang/bn.js +6 -0
  83. data/vendor/assets/javascripts/ckeditor/lang/bs.js +6 -0
  84. data/vendor/assets/javascripts/ckeditor/lang/ca.js +6 -0
  85. data/vendor/assets/javascripts/ckeditor/lang/cs.js +6 -0
  86. data/vendor/assets/javascripts/ckeditor/lang/cy.js +6 -0
  87. data/vendor/assets/javascripts/ckeditor/lang/da.js +6 -0
  88. data/vendor/assets/javascripts/ckeditor/lang/de.js +6 -0
  89. data/vendor/assets/javascripts/ckeditor/lang/el.js +6 -0
  90. data/vendor/assets/javascripts/ckeditor/lang/en-au.js +6 -0
  91. data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +6 -0
  92. data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +6 -0
  93. data/vendor/assets/javascripts/ckeditor/lang/en.js +6 -0
  94. data/vendor/assets/javascripts/ckeditor/lang/eo.js +6 -0
  95. data/vendor/assets/javascripts/ckeditor/lang/es.js +6 -0
  96. data/vendor/assets/javascripts/ckeditor/lang/et.js +6 -0
  97. data/vendor/assets/javascripts/ckeditor/lang/eu.js +6 -0
  98. data/vendor/assets/javascripts/ckeditor/lang/fa.js +6 -0
  99. data/vendor/assets/javascripts/ckeditor/lang/fi.js +6 -0
  100. data/vendor/assets/javascripts/ckeditor/lang/fo.js +6 -0
  101. data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +6 -0
  102. data/vendor/assets/javascripts/ckeditor/lang/fr.js +6 -0
  103. data/vendor/assets/javascripts/ckeditor/lang/gl.js +6 -0
  104. data/vendor/assets/javascripts/ckeditor/lang/gu.js +6 -0
  105. data/vendor/assets/javascripts/ckeditor/lang/he.js +6 -0
  106. data/vendor/assets/javascripts/ckeditor/lang/hi.js +6 -0
  107. data/vendor/assets/javascripts/ckeditor/lang/hr.js +6 -0
  108. data/vendor/assets/javascripts/ckeditor/lang/hu.js +6 -0
  109. data/vendor/assets/javascripts/ckeditor/lang/is.js +6 -0
  110. data/vendor/assets/javascripts/ckeditor/lang/it.js +6 -0
  111. data/vendor/assets/javascripts/ckeditor/lang/ja.js +6 -0
  112. data/vendor/assets/javascripts/ckeditor/lang/ka.js +6 -0
  113. data/vendor/assets/javascripts/ckeditor/lang/km.js +6 -0
  114. data/vendor/assets/javascripts/ckeditor/lang/ko.js +6 -0
  115. data/vendor/assets/javascripts/ckeditor/lang/lt.js +6 -0
  116. data/vendor/assets/javascripts/ckeditor/lang/lv.js +6 -0
  117. data/vendor/assets/javascripts/ckeditor/lang/mn.js +6 -0
  118. data/vendor/assets/javascripts/ckeditor/lang/ms.js +6 -0
  119. data/vendor/assets/javascripts/ckeditor/lang/nb.js +6 -0
  120. data/vendor/assets/javascripts/ckeditor/lang/nl.js +6 -0
  121. data/vendor/assets/javascripts/ckeditor/lang/no.js +6 -0
  122. data/vendor/assets/javascripts/ckeditor/lang/pl.js +6 -0
  123. data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +6 -0
  124. data/vendor/assets/javascripts/ckeditor/lang/pt.js +6 -0
  125. data/vendor/assets/javascripts/ckeditor/lang/ro.js +6 -0
  126. data/vendor/assets/javascripts/ckeditor/lang/ru.js +6 -0
  127. data/vendor/assets/javascripts/ckeditor/lang/sk.js +6 -0
  128. data/vendor/assets/javascripts/ckeditor/lang/sl.js +6 -0
  129. data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +6 -0
  130. data/vendor/assets/javascripts/ckeditor/lang/sr.js +6 -0
  131. data/vendor/assets/javascripts/ckeditor/lang/sv.js +6 -0
  132. data/vendor/assets/javascripts/ckeditor/lang/th.js +6 -0
  133. data/vendor/assets/javascripts/ckeditor/lang/tr.js +6 -0
  134. data/vendor/assets/javascripts/ckeditor/lang/uk.js +6 -0
  135. data/vendor/assets/javascripts/ckeditor/lang/vi.js +6 -0
  136. data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +6 -0
  137. data/vendor/assets/javascripts/ckeditor/lang/zh.js +6 -0
  138. data/{app → vendor}/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +1 -1
  139. data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/en.js +6 -0
  140. data/{app → vendor}/assets/javascripts/ckeditor/plugins/a11yhelp/lang/he.js +0 -0
  141. data/{app → vendor}/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +1 -1
  142. data/{app → vendor}/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
  143. data/{app → vendor}/assets/javascripts/ckeditor/plugins/adobeair/plugin.js +0 -0
  144. data/vendor/assets/javascripts/ckeditor/plugins/ajax/plugin.js +6 -0
  145. data/vendor/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +6 -0
  146. data/vendor/assets/javascripts/ckeditor/plugins/bbcode/plugin.js +9 -0
  147. data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +7 -0
  148. data/{app → vendor}/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +0 -0
  149. data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/en.js +6 -0
  150. data/vendor/assets/javascripts/ckeditor/plugins/devtools/plugin.js +6 -0
  151. data/{app → vendor}/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +0 -0
  152. data/{app → vendor}/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +0 -0
  153. data/vendor/assets/javascripts/ckeditor/plugins/docprops/dialogs/docprops.js +10 -0
  154. data/vendor/assets/javascripts/ckeditor/plugins/docprops/plugin.js +6 -0
  155. data/{app → vendor}/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +3 -2
  156. data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +9 -0
  157. data/{app → vendor}/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png +0 -0
  158. data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +0 -0
  159. data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +0 -0
  160. data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +0 -0
  161. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +6 -0
  162. data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +0 -0
  163. data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +9 -0
  164. data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +0 -0
  165. data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +0 -0
  166. data/{app → vendor}/assets/javascripts/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
  167. data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +7 -0
  168. data/{app → vendor}/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
  169. data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +6 -0
  170. data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +13 -0
  171. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +6 -0
  172. data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +12 -0
  173. data/{app → vendor}/assets/javascripts/ckeditor/plugins/link/images/anchor.gif +0 -0
  174. data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +7 -0
  175. data/{app → vendor}/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
  176. data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +11 -0
  177. data/vendor/assets/javascripts/ckeditor/plugins/pastetext/dialogs/pastetext.js +6 -0
  178. data/{app → vendor}/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +0 -0
  179. data/{app → vendor}/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +0 -0
  180. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +6 -0
  181. data/{app → vendor}/assets/javascripts/ckeditor/plugins/placeholder/placeholder.gif +0 -0
  182. data/vendor/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +6 -0
  183. data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +8 -0
  184. data/{app → vendor}/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -0
  185. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
  186. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
  187. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
  188. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
  189. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
  190. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
  191. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
  192. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
  193. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
  194. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
  195. data/{app → vendor}/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
  196. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +1 -1
  197. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
  198. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
  199. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
  200. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
  201. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
  202. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
  203. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
  204. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif +0 -0
  205. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif +0 -0
  206. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif +0 -0
  207. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
  208. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
  209. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
  210. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
  211. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
  212. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
  213. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
  214. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
  215. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
  216. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
  217. data/{app → vendor}/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
  218. data/{app → vendor}/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +1 -1
  219. data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/en.js +6 -0
  220. data/{app → vendor}/assets/javascripts/ckeditor/plugins/styles/styles/default.js +0 -0
  221. data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +6 -0
  222. data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +9 -0
  223. data/vendor/assets/javascripts/ckeditor/plugins/tableresize/plugin.js +7 -0
  224. data/{app → vendor}/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +1 -1
  225. data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +1 -1
  226. data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/templates/default.js +0 -0
  227. data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
  228. data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
  229. data/{app → vendor}/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
  230. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/dialogs/uicolor.js +0 -0
  231. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/lang/en.js +0 -0
  232. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/lang/he.js +0 -0
  233. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/plugin.js +0 -0
  234. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/uicolor.gif +0 -0
  235. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
  236. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
  237. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
  238. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
  239. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css +0 -0
  240. data/{app → vendor}/assets/javascripts/ckeditor/plugins/uicolor/yui/yui.js +0 -0
  241. data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -0
  242. data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -0
  243. data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +0 -0
  244. data/{app → vendor}/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +0 -0
  245. data/vendor/assets/javascripts/ckeditor/plugins/xml/plugin.js +6 -0
  246. data/vendor/assets/javascripts/ckeditor/skins/kama/dialog.css +10 -0
  247. data/vendor/assets/javascripts/ckeditor/skins/kama/editor.css +13 -0
  248. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/icons.png +0 -0
  249. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/icons_rtl.png +0 -0
  250. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
  251. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/images/dialog_sides.png +0 -0
  252. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
  253. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/images/mini.gif +0 -0
  254. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/images/noimage.png +0 -0
  255. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/images/sprites.png +0 -0
  256. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
  257. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
  258. data/vendor/assets/javascripts/ckeditor/skins/kama/skin.js +7 -0
  259. data/{app → vendor}/assets/javascripts/ckeditor/skins/kama/templates.css +0 -0
  260. data/vendor/assets/javascripts/ckeditor/skins/office2003/dialog.css +9 -0
  261. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/editor.css +5 -5
  262. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/icons.png +0 -0
  263. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/icons_rtl.png +0 -0
  264. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
  265. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
  266. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
  267. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/images/mini.gif +0 -0
  268. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/images/noimage.png +0 -0
  269. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/images/sprites.png +0 -0
  270. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
  271. data/vendor/assets/javascripts/ckeditor/skins/office2003/skin.js +6 -0
  272. data/{app → vendor}/assets/javascripts/ckeditor/skins/office2003/templates.css +0 -0
  273. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/dialog.css +3 -3
  274. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/editor.css +4 -4
  275. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/icons.png +0 -0
  276. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/icons_rtl.png +0 -0
  277. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
  278. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/images/dialog_sides.png +0 -0
  279. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
  280. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/images/mini.gif +0 -0
  281. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/images/noimage.png +0 -0
  282. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/images/sprites.png +0 -0
  283. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
  284. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
  285. data/vendor/assets/javascripts/ckeditor/skins/v2/skin.js +6 -0
  286. data/{app → vendor}/assets/javascripts/ckeditor/skins/v2/templates.css +0 -0
  287. data/vendor/assets/javascripts/ckeditor/themes/default/theme.js +8 -0
  288. data/{app → vendor}/assets/javascripts/hoverIntent.js +0 -0
  289. data/vendor/assets/javascripts/jqcloud-0.1.3.js +87 -0
  290. data/{app → vendor}/assets/javascripts/jquery.ba-url.js +0 -0
  291. data/{app → vendor}/assets/javascripts/jquery.fcbkcomplete.js +0 -0
  292. data/{app → vendor}/assets/javascripts/jquery.livequery.js +0 -0
  293. data/{app → vendor}/assets/javascripts/jquery.scrollTo.min.js +0 -0
  294. data/{app → vendor}/assets/javascripts/jquery.validate.js +0 -0
  295. data/{app → vendor}/assets/javascripts/menu.js +0 -0
  296. data/{app → vendor}/assets/javascripts/superfish.js +0 -0
  297. data/{app → vendor}/assets/javascripts/ui.checkbox.js +0 -0
  298. metadata +288 -257
  299. data/app/assets/javascripts/ckeditor/ckeditor.js +0 -141
  300. data/app/assets/javascripts/ckeditor/ckeditor_basic.js +0 -8
  301. data/app/assets/javascripts/ckeditor/contents.css +0 -45
  302. data/app/assets/javascripts/ckeditor/lang/_translationstatus.txt +0 -60
  303. data/app/assets/javascripts/ckeditor/lang/af.js +0 -6
  304. data/app/assets/javascripts/ckeditor/lang/ar.js +0 -6
  305. data/app/assets/javascripts/ckeditor/lang/bg.js +0 -6
  306. data/app/assets/javascripts/ckeditor/lang/bn.js +0 -6
  307. data/app/assets/javascripts/ckeditor/lang/bs.js +0 -6
  308. data/app/assets/javascripts/ckeditor/lang/ca.js +0 -6
  309. data/app/assets/javascripts/ckeditor/lang/cs.js +0 -6
  310. data/app/assets/javascripts/ckeditor/lang/cy.js +0 -6
  311. data/app/assets/javascripts/ckeditor/lang/da.js +0 -6
  312. data/app/assets/javascripts/ckeditor/lang/de.js +0 -6
  313. data/app/assets/javascripts/ckeditor/lang/el.js +0 -6
  314. data/app/assets/javascripts/ckeditor/lang/en-au.js +0 -6
  315. data/app/assets/javascripts/ckeditor/lang/en-ca.js +0 -6
  316. data/app/assets/javascripts/ckeditor/lang/en-gb.js +0 -6
  317. data/app/assets/javascripts/ckeditor/lang/en.js +0 -6
  318. data/app/assets/javascripts/ckeditor/lang/eo.js +0 -6
  319. data/app/assets/javascripts/ckeditor/lang/es.js +0 -6
  320. data/app/assets/javascripts/ckeditor/lang/et.js +0 -6
  321. data/app/assets/javascripts/ckeditor/lang/eu.js +0 -6
  322. data/app/assets/javascripts/ckeditor/lang/fa.js +0 -6
  323. data/app/assets/javascripts/ckeditor/lang/fi.js +0 -6
  324. data/app/assets/javascripts/ckeditor/lang/fo.js +0 -6
  325. data/app/assets/javascripts/ckeditor/lang/fr-ca.js +0 -6
  326. data/app/assets/javascripts/ckeditor/lang/fr.js +0 -6
  327. data/app/assets/javascripts/ckeditor/lang/gl.js +0 -6
  328. data/app/assets/javascripts/ckeditor/lang/gu.js +0 -6
  329. data/app/assets/javascripts/ckeditor/lang/he.js +0 -6
  330. data/app/assets/javascripts/ckeditor/lang/hi.js +0 -6
  331. data/app/assets/javascripts/ckeditor/lang/hr.js +0 -6
  332. data/app/assets/javascripts/ckeditor/lang/hu.js +0 -6
  333. data/app/assets/javascripts/ckeditor/lang/is.js +0 -6
  334. data/app/assets/javascripts/ckeditor/lang/it.js +0 -6
  335. data/app/assets/javascripts/ckeditor/lang/ja.js +0 -6
  336. data/app/assets/javascripts/ckeditor/lang/km.js +0 -6
  337. data/app/assets/javascripts/ckeditor/lang/ko.js +0 -6
  338. data/app/assets/javascripts/ckeditor/lang/lt.js +0 -6
  339. data/app/assets/javascripts/ckeditor/lang/lv.js +0 -6
  340. data/app/assets/javascripts/ckeditor/lang/mn.js +0 -6
  341. data/app/assets/javascripts/ckeditor/lang/ms.js +0 -6
  342. data/app/assets/javascripts/ckeditor/lang/nb.js +0 -6
  343. data/app/assets/javascripts/ckeditor/lang/nl.js +0 -6
  344. data/app/assets/javascripts/ckeditor/lang/no.js +0 -6
  345. data/app/assets/javascripts/ckeditor/lang/pl.js +0 -6
  346. data/app/assets/javascripts/ckeditor/lang/pt-br.js +0 -6
  347. data/app/assets/javascripts/ckeditor/lang/pt.js +0 -6
  348. data/app/assets/javascripts/ckeditor/lang/ro.js +0 -6
  349. data/app/assets/javascripts/ckeditor/lang/ru.js +0 -6
  350. data/app/assets/javascripts/ckeditor/lang/sk.js +0 -6
  351. data/app/assets/javascripts/ckeditor/lang/sl.js +0 -6
  352. data/app/assets/javascripts/ckeditor/lang/sr-latn.js +0 -6
  353. data/app/assets/javascripts/ckeditor/lang/sr.js +0 -6
  354. data/app/assets/javascripts/ckeditor/lang/sv.js +0 -6
  355. data/app/assets/javascripts/ckeditor/lang/th.js +0 -6
  356. data/app/assets/javascripts/ckeditor/lang/tr.js +0 -6
  357. data/app/assets/javascripts/ckeditor/lang/uk.js +0 -6
  358. data/app/assets/javascripts/ckeditor/lang/vi.js +0 -6
  359. data/app/assets/javascripts/ckeditor/lang/zh-cn.js +0 -6
  360. data/app/assets/javascripts/ckeditor/lang/zh.js +0 -6
  361. data/app/assets/javascripts/ckeditor/plugins/a11yhelp/lang/en.js +0 -6
  362. data/app/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +0 -6
  363. data/app/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -7
  364. data/app/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +0 -9
  365. data/app/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +0 -6
  366. data/app/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +0 -9
  367. data/app/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +0 -7
  368. data/app/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -6
  369. data/app/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +0 -13
  370. data/app/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +0 -6
  371. data/app/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +0 -11
  372. data/app/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +0 -6
  373. data/app/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +0 -10
  374. data/app/assets/javascripts/ckeditor/plugins/pastetext/dialogs/pastetext.js +0 -6
  375. data/app/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +0 -6
  376. data/app/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +0 -8
  377. data/app/assets/javascripts/ckeditor/plugins/specialchar/lang/en.js +0 -6
  378. data/app/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +0 -9
  379. data/app/assets/javascripts/ckeditor/plugins/tableresize/plugin.js +0 -7
  380. data/app/assets/javascripts/ckeditor/skins/kama/dialog.css +0 -9
  381. data/app/assets/javascripts/ckeditor/skins/kama/editor.css +0 -13
  382. data/app/assets/javascripts/ckeditor/skins/kama/skin.js +0 -7
  383. data/app/assets/javascripts/ckeditor/skins/office2003/dialog.css +0 -9
  384. data/app/assets/javascripts/ckeditor/skins/office2003/skin.js +0 -6
  385. data/app/assets/javascripts/ckeditor/skins/v2/skin.js +0 -6
  386. data/app/assets/javascripts/ckeditor/themes/default/theme.js +0 -8
  387. data/app/assets/javascripts/jqcloud-0.1.3.min.js +0 -11
  388. data/app/assets/javascripts/jquery.boxy.js +0 -570
  389. data/app/assets/javascripts/jquery.fcbkcomplete.min.js +0 -2
  390. data/app/assets/javascripts/menu-collapsed.js +0 -42
  391. data/app/assets/javascripts/modernizr.min.js +0 -4
  392. data/app/assets/javascripts/rails.js +0 -158
  393. data/app/assets/javascripts/ui.dropdownchecklist.js +0 -922
  394. data/app/views/contacts/_edit.html.erb +0 -76
  395. data/app/views/home/_menu.html.erb +0 -46
  396. data/app/views/posts/_header.html.erb +0 -1
  397. data/app/views/subjects/_tabs.html.erb +0 -38
data/.travis.yml CHANGED
@@ -1,3 +1,4 @@
1
1
  rvm:
2
2
  - 1.8.7
3
3
  - 1.9.2
4
+ - ree
Binary file
Binary file
Binary file
@@ -1,10 +1,15 @@
1
+ //= require jquery.livequery
2
+ //
1
3
  //initial state
2
- $('#wrapper_activities_header form').hide();
3
- $('#new_post').show();
4
+ $(function() {
5
+ $('#wrapper_activities_header form').hide();
6
+ $('#new_<%= SocialStream.activity_forms.first %>').show();
7
+ $('#select_<%= SocialStream.activity_forms.first %>').addClass('selected');
8
+ });
4
9
 
5
10
  //clicks on headers
6
- $('.activities_title_header').live('click',function(){
7
- $('.activities_title_header').removeClass('selected');
11
+ $('.activity_form_selector').live('click',function(){
12
+ $('.activity_form_selector').removeClass('selected');
8
13
  $(this).addClass('selected');
9
14
  $('#wrapper_activities_header form').hide();
10
15
  $('#new_'+this.id.split("_")[1]).show();
@@ -24,22 +29,26 @@ $('#masterSubmitButton').live('click',function(){
24
29
  });
25
30
 
26
31
  //javascript for main activities input
27
- title = "<%= t('activity.input') %>";
28
- $("#input_activities").click(function(){
29
- if(this.value == title){
30
- this.value="";
31
- $("#masterSubmitButton").show();
32
- }
32
+ $(function() {
33
+ activity_input = "<%= I18n.t('activity.input') %>";
34
+ $("#input_activities").click(function(){
35
+ if(this.value == activity_input){
36
+ this.value = "";
37
+ $("#masterSubmitButton").show();
38
+ }
39
+ });
33
40
  });
34
41
 
35
42
 
36
43
  //javascript for comments
37
- $(".input_new_comments").val("<%= t('comment.input') %>");
38
- $(".activities_comment_btn").hide();
44
+ $(function() {
45
+ $(".input_new_comments").val("<%= I18n.t('comment.input') %>");
46
+ $(".activities_comment_btn").hide();
47
+ });
39
48
 
40
49
  //usa livequery para usar el javascript luego de una accion con AJAX
41
50
  $(".input_new_comments").livequery("click",function(){
42
- if(this.value == "<%= t('comment.input') %>"){
51
+ if(this.value == "<%= I18n.t('comment.input') %>"){
43
52
  $(this).val("");
44
53
  }
45
54
  $(".activities_comment_btn").hide();
@@ -48,12 +57,12 @@ $(".input_new_comments").livequery("click",function(){
48
57
  $(".input_new_comments").livequery("blur",function(){
49
58
  if(this.value == ""){
50
59
  $(".activities_comment_btn").hide();
51
- $(this).val("<%= t('comment.input') %>");
60
+ $(this).val("<%= I18n.t('comment.input') %>");
52
61
  }
53
62
  });
54
63
 
55
64
  $(".input_new_comments").click(function(){
56
- if(this.value == "<%= t('comment.input') %>"){
65
+ if(this.value == "<%= I18n.t('comment.input') %>"){
57
66
  $(this).val("");
58
67
  }
59
68
  $(".activities_comment_btn").hide();
@@ -0,0 +1,4 @@
1
+ //= require ckeditor/ckeditor
2
+ //= require ckeditor/adapters/jquery
3
+
4
+ CKEDITOR.basePath = "<%= asset_path "ckeditor/" %>";
@@ -0,0 +1,10 @@
1
+ // index
2
+ //= require jquery.ba-url
3
+ //= require ajax.paginate
4
+ //
5
+ // edit
6
+ //= require ui.checkbox
7
+
8
+ $(function() {
9
+ $('input[id^="relation_custom"]').checkBox();
10
+ });
@@ -0,0 +1,3 @@
1
+ //= require jquery.scrollTo.min
2
+ //= require jquery.validate
3
+ //= require ckeditor.rails
@@ -0,0 +1,5 @@
1
+ //= require jqcloud-0.1.3
2
+ //= require jquery.fcbkcomplete
3
+ //= require jquery.validate
4
+ //= require jquery.ba-url
5
+ //= require ajax.paginate
@@ -0,0 +1 @@
1
+ //= require jquery.validate
@@ -1,7 +1,7 @@
1
- // initialise plugins
2
- jQuery(function(){
3
-
4
-
1
+ //= require hoverIntent
2
+ //= require superfish
3
+ //
4
+ $(function() {
5
5
  jQuery('ul.sf-menu').superfish({
6
6
  delay: 2000, // one second delay on mouseout
7
7
  animation: {
@@ -11,13 +11,7 @@ jQuery(function(){
11
11
  autoArrows: false,
12
12
  dropShadows: false // disable drop shadows
13
13
  });
14
-
15
-
16
- });
17
-
18
14
 
19
-
20
- $(document).ready(function(){
21
15
  $('#tabright> ul').tabs({
22
16
  fx: {
23
17
  height: 'toggle',
@@ -25,4 +19,3 @@ $(document).ready(function(){
25
19
  }
26
20
  });
27
21
  });
28
-
@@ -0,0 +1,3 @@
1
+ //= require jquery.fcbkcomplete
2
+ //= require jquery.validate
3
+ //= require ckeditor.rails
@@ -0,0 +1,6 @@
1
+ //= require jquery.validate
2
+ //= require jquery.fcbkcomplete
3
+
4
+ $(function() {
5
+ $(".edit_profile").validate();
6
+ });
@@ -1,3 +1,5 @@
1
+ //= require ui.checkbox
2
+
1
3
  var relations;
2
4
 
3
5
  function checkBoxId(id) {
@@ -27,10 +29,14 @@ function checkBoxEnable(id) {
27
29
  switch (checkBoxType(id)) {
28
30
 
29
31
  case "relation_custom":
32
+ if ($('#' + id).parents().hasClass('edit_contact')) {
33
+ break;
34
+ };
35
+
30
36
  $(':checkbox[id^="relation_custom"]:checked:not(#' + id + ')').checkBox('changeCheckStatus', false);
31
37
 
32
38
  $.ajax({
33
- url: "<%= permissions_path %>",
39
+ url: "../permissions",
34
40
  context: document.body,
35
41
  data: { relation_id: checkBoxId(id) },
36
42
  dataType: "script"
@@ -55,7 +61,11 @@ function checkBoxDisable(id) {
55
61
  switch (checkBoxType(id)) {
56
62
 
57
63
  case "relation_custom":
58
- $("#permissions").html("");
64
+ if ($('#' + id).parents().hasClass('edit_contact')) {
65
+ break;
66
+ };
67
+
68
+ $("#permissions").html("");
59
69
  $("#permissions").hide();
60
70
 
61
71
  break;
@@ -32,4 +32,4 @@ showApiKeySettings = function() {
32
32
  $("#api_key_settings_briefing").hide("slow");
33
33
  api_key_open = true;
34
34
  }
35
- }
35
+ }
@@ -0,0 +1,6 @@
1
+ //= require jquery
2
+ //= require jquery_ujs
3
+ //= require jquery-ui
4
+ //= require modernizr
5
+ //
6
+ //= require_tree .
@@ -0,0 +1 @@
1
+ //= require menu
@@ -0,0 +1,2 @@
1
+ //= require jquery.ba-url
2
+ //= require ajax.paginate
@@ -199,12 +199,28 @@ textarea.new_contact_text_area{ width:100%; height: 100px; color: #2A3890;}
199
199
  padding: 2px;
200
200
  margin-right: 10px;
201
201
  margin-bottom: 5px;
202
- cursor: pointer;
202
+ border: 2px solid transparent;
203
+ color: #000000;
204
+ }
205
+
206
+ .activities_title_header img{
207
+ margin-bottom: -4px;
208
+ margin-right: 4px;
209
+ }
210
+
211
+ #activity_form_select {
212
+ margin-left: 10px;
213
+ }
214
+
215
+ .activity_form_selector{
216
+ padding: 2px;
217
+ margin-bottom: 5px;
203
218
  float: left;
204
219
  border: 2px solid transparent;
220
+ cursor: pointer;
205
221
  }
206
222
 
207
- .activities_title_header.selected{
223
+ .activity_form_selector.selected{
208
224
  border: 2px solid #46B9E8;
209
225
  }
210
226
 
@@ -2,21 +2,18 @@ class ContactsController < ApplicationController
2
2
  before_filter :authenticate_user!
3
3
 
4
4
  def index
5
+ if params[:pending].present?
6
+ pending
7
+ return
8
+ end
5
9
  @contacts =
6
10
  Contact.sent_by(current_subject).
7
11
  joins(:receiver).merge(Actor.alphabetic).
8
12
  merge(Actor.letter(params[:letter])).
9
- merge(Actor.search(params[:search]))
10
-
11
- if params[:pending].present?
12
- @contacts =
13
- Contact.received_by(current_subject).
14
- joins(:sender).merge(Actor.alphabetic).
15
- merge(Actor.letter(params[:letter])).
16
13
  merge(Actor.search(params[:search])).
17
- pending.
18
- not_reflexive
19
- end
14
+ active
15
+
16
+
20
17
 
21
18
  respond_to do |format|
22
19
  format.html { @contacts = @contacts.page(params[:page]).per(10) }
@@ -53,4 +50,15 @@ class ContactsController < ApplicationController
53
50
  format.js
54
51
  end
55
52
  end
53
+
54
+ def pending
55
+
56
+ @contacts = current_subject.pending_contacts
57
+
58
+ respond_to do |format|
59
+ format.html { @contacts = Kaminari.paginate_array(@contacts).page(params[:page]).per(10) }
60
+ format.js { Kaminari.paginate_array(@contacts).page(params[:page]).per(10) }
61
+ format.json { render :text => @contacts.map{ |c| { 'key' => c.actor_id.to_s, 'value' => self.class.helpers.truncate_name(c.name) } }.to_json }
62
+ end
63
+ end
56
64
  end
@@ -3,17 +3,25 @@ module NotificationsHelper
3
3
 
4
4
  def decode_notification notification_text, activity
5
5
  return if activity.nil?
6
- notification_text = notification_text.gsub(/\%\{sender\}/, link_to(truncate_name(activity.sender.name), activity.sender.subject))
7
- notification_text = notification_text.gsub(/\%\{confirm\}/,link_to(t('notification.confirm'),edit_contact_path(activity.receiver.contact_to!(activity.sender))))
8
- notification_text = notification_text.gsub(/\%\{look\}/,link_to(t('notification.look'),activity.sender.subject))
6
+ notification_text = notification_text.gsub(/\%\{sender\}/, link_to(truncate_name(activity.sender.name),
7
+ url_for(:controller=> activity.sender.subject.class.to_s.downcase.pluralize,
8
+ :action=> :show, :id=> activity.sender.subject.slug, :only_path => false)))
9
+ notification_text = notification_text.gsub(/\%\{confirm\}/,link_to(t('notification.confirm'),edit_contact_url(activity.receiver.contact_to!(activity.sender))))
10
+ notification_text = notification_text.gsub(/\%\{look\}/,link_to(t('notification.look'),
11
+ url_for(:controller=> activity.sender.subject.class.to_s.downcase.pluralize,
12
+ :action=> :show, :id=> activity.sender.subject.slug, :only_path => false)))
9
13
  notification_text = notification_text.gsub(/\%\{sender.name\}/,truncate_name(activity.sender.name))
10
14
 
11
15
  if activity.direct_object.present?
12
16
  object = activity.direct_object
13
17
  object = object.subject if object.is_a? Actor
14
- notification_text=notification_text.gsub(/\%\{object\}/,link_to(object.class.to_s.downcase,object))
18
+ notification_text=notification_text.gsub(/\%\{object\}/,link_to(object.class.to_s.downcase,
19
+ url_for(:controller=> object.class.to_s.downcase.pluralize, :action=> :show,
20
+ :id=> object.id, :only_path => false)))
15
21
  notification_text=notification_text.gsub(/\%\{object.name\}/,object.class.to_s.downcase)
16
- notification_text=notification_text.gsub(/\%\{object.text\}/,link_to(object.text.truncate(100, :separator =>' '), object)) if object.respond_to? :text
22
+ notification_text=notification_text.gsub(/\%\{object.text\}/,link_to(object.text.truncate(100, :separator =>' '),
23
+ url_for(:controller=> object.class.to_s.downcase.pluralize, :action=> :show,
24
+ :id=> object.id, :only_path => false))) if object.respond_to? :text
17
25
  #notification_text=notification_text.gsub(/\%\{object.image\}/,thumb_for(object)) if SocialStream.activity_forms.include? :document and object.is_a? Document
18
26
 
19
27
  else
@@ -211,25 +211,24 @@ class Activity < ActiveRecord::Base
211
211
  when 'create'
212
212
  return false if contact.sender_id != Actor.normalize_id(subject)
213
213
 
214
- if relation_ids.present?
215
- rels = Relation.normalize(relation_ids)
214
+ val =
215
+ if relation_ids.present?
216
+ rels = Relation.normalize(relation_ids)
216
217
 
217
- foreign_rels = rels.select{ |r| r.actor_id != contact.sender_id }
218
+ foreign_rels = rels.select{ |r| r.actor_id != contact.sender_id }
218
219
 
219
- # Only posting to own relations
220
- return true if foreign_rels.blank?
221
-
222
- return Relation.
223
- allow(subject, action, 'activity', :in => foreign_rels).all.size == foreign_rels.size
224
- else
225
- if contact.reflexive?
226
- return true
220
+ # Only posting to own relations
221
+ foreign_rels.blank? ||
222
+ Relation.
223
+ allow(subject, action, 'activity', :in => foreign_rels).all.size == foreign_rels.size
227
224
  else
228
- receiver.
229
- relation_customs.allow(sender, 'create', 'activity').
230
- present?
225
+ contact.reflexive? ||
226
+ receiver.
227
+ relation_customs.allow(sender, 'create', 'activity').
228
+ present?
231
229
  end
232
- end
230
+
231
+ return val
233
232
 
234
233
  when 'read'
235
234
  return true if [contact.sender_id, contact.receiver_id].include?(Actor.normalize_id(subject)) || relations.select{ |r| r.is_a?(Relation::Public) }.any?
data/app/models/actor.rb CHANGED
@@ -225,9 +225,15 @@ class Actor < ActiveRecord::Base
225
225
  as.map(&:subject)
226
226
  end
227
227
 
228
+ # Return a contact to subject.
229
+ def contact_to(subject)
230
+ sent_contacts.received_by(subject).first
231
+ end
232
+
228
233
  # Return a contact to subject. Create it if it does not exist
229
234
  def contact_to!(subject)
230
- Contact.find_or_create_by_sender_id_and_receiver_id id, Actor.normalize_id(subject)
235
+ contact_to(subject) ||
236
+ sent_contacts.create!(:receiver_id => Actor.normalize_id(subject))
231
237
  end
232
238
 
233
239
  # This is an scaffold for a recomendations engine
@@ -93,7 +93,7 @@ class Relation < ActiveRecord::Base
93
93
  end
94
94
 
95
95
  # Add in condition
96
- if options[:in].present?
96
+ if ! options[:in].nil?
97
97
  conds = conds.and(Relation.arel_table[:id].in(Relation.normalize_id(Array(options[:in]))))
98
98
  end
99
99
 
data/app/models/tie.rb CHANGED
@@ -88,7 +88,7 @@ class Tie < ActiveRecord::Base
88
88
  #
89
89
  # Create contact activity if this is the first tie
90
90
  def create_activity
91
- return if contact.reload.ties_count != 1
91
+ return if contact.reload.ties_count != 1 || relation.is_a?(Relation::Public)
92
92
 
93
93
  Activity.create! :contact => contact,
94
94
  :relation_ids => contact.relation_ids,
@@ -3,18 +3,12 @@
3
3
  <%= stylesheet_link_tag "jquery-ui", :media => "screen, projection" %>
4
4
  <% end %>
5
5
 
6
- <% content_for :javascript do %>
7
- <%= render :partial => 'activities/jquery' %>
8
- <% end -%>
9
-
10
6
  <div id="wrapper_activities">
11
7
  <div id="wrapper_activities_header">
12
8
  <div id="activities_title" class="content_size">
13
- <% SocialStream.activity_forms.each do |element| %>
14
- <div id="header_<%= element %>" class="activities_title_header">
15
- <%= render :partial => element.to_s.pluralize+'/header' %>
16
- </div>
17
- <% end %>
9
+ <div class="activities_title_header">
10
+ <%= image_tag("btn/activity.png") %><%= t 'activity.title' %>
11
+ </div>
18
12
  </div>
19
13
  <%= render :partial => 'activities/new', :locals => { :receiver => owner } %>
20
14
  </div>
@@ -18,6 +18,14 @@
18
18
  <% end %>
19
19
  </div>
20
20
 
21
+ <div id="activity_form_select">
22
+ <% SocialStream.activity_forms.each do |element| %>
23
+ <div id="select_<%= element %>" class="activity_form_selector">
24
+ <%= image_tag "btn/#{ element }.png", :title => t("#{ element }.form.title") %>
25
+ </div>
26
+ <% end %>
27
+ </div>
28
+
21
29
  <div id="activities_share_btn">
22
30
  <% if current_subject == receiver %>
23
31
  <div id="securities"><%= select_tag :_relation_ids, options_for_select(current_subject.activity_relations(receiver).sort.map{ |r| [ r.name, r.id ] }), :id => 'security', :multiple => nil %></div>