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.
- data/app/assets/images/cleditor/buttons.gif +0 -0
- data/app/assets/images/cleditor/toolbar.gif +0 -0
- data/app/assets/javascripts/conversations.js +1 -1
- data/app/assets/javascripts/messages.js +1 -1
- data/app/assets/stylesheets/conversations.css +1 -0
- data/app/assets/stylesheets/messages.css +1 -0
- data/app/controllers/groups_controller.rb +6 -0
- data/app/controllers/users_controller.rb +6 -0
- data/app/helpers/contacts_helper.rb +8 -10
- data/app/helpers/profiles_helper.rb +6 -0
- data/app/models/activity.rb +2 -0
- data/app/models/activity_object.rb +3 -3
- data/app/models/actor.rb +24 -43
- data/app/models/contact.rb +23 -10
- data/app/views/contacts/_contact.html.erb +1 -1
- data/app/views/contacts/_pendings.html.erb +2 -2
- data/app/views/contacts/_suggestions.html.erb +2 -4
- data/app/views/contacts/destroy.js.erb +1 -1
- data/app/views/conversations/show.html.erb +6 -17
- data/app/views/conversations/show.js.erb +16 -27
- data/app/views/messages/_new.html.erb +1 -4
- data/app/views/messages/new.html.erb +10 -22
- data/app/views/messages/new.js.erb +9 -16
- data/app/views/profiles/_contact.html.erb +1 -1
- data/config/locales/en.yml +4 -1
- data/lib/social_stream/base/version.rb +1 -1
- data/lib/social_stream/models/supertype.rb +9 -7
- data/lib/social_stream/toolbar_config.rb +5 -5
- data/social_stream-base.gemspec +1 -1
- data/spec/controllers/relation_customs_controller_spec.rb +2 -1
- data/spec/factories/relation_custom.rb +1 -1
- data/spec/models/actor_spec.rb +5 -5
- data/spec/models/tie_spec.rb +17 -0
- data/vendor/assets/javascripts/jquery.cleditor.min.js +31 -0
- data/vendor/assets/stylesheets/jquery.cleditor.css +24 -0
- metadata +10 -229
- data/app/assets/javascripts/ckeditor.rails.js.erb +0 -4
- data/app/views/conversations/_menu_options.html.erb +0 -19
- data/spec/factories/actor.rb +0 -5
- data/vendor/assets/javascripts/ckeditor/.htaccess +0 -24
- data/vendor/assets/javascripts/ckeditor/adapters/jquery.js +0 -6
- data/vendor/assets/javascripts/ckeditor/ckeditor.js +0 -147
- data/vendor/assets/javascripts/ckeditor/ckeditor_basic.js +0 -8
- data/vendor/assets/javascripts/ckeditor/ckeditor_basic_source.js +0 -20
- data/vendor/assets/javascripts/ckeditor/ckeditor_source.js +0 -25
- data/vendor/assets/javascripts/ckeditor/config.js +0 -23
- data/vendor/assets/javascripts/ckeditor/contents.css +0 -25
- data/vendor/assets/javascripts/ckeditor/images/spacer.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/lang/_languages.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/_translationstatus.txt +0 -61
- data/vendor/assets/javascripts/ckeditor/lang/af.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/ar.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/bg.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/bn.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/bs.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/ca.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/cs.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/cy.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/da.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/de.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/el.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/en-au.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/en-ca.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/en-gb.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/eo.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/es.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/et.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/eu.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/fa.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/fi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/fo.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/fr-ca.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/fr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/gl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/gu.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/he.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/hi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/hr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/hu.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/is.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/it.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/ja.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/ka.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/km.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/ko.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/lt.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/lv.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/mn.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/ms.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/nb.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/nl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/no.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/pl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/pt-br.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/pt.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/ro.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/ru.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/sk.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/sl.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/sr-latn.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/sr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/sv.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/th.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/tr.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/uk.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/vi.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/zh-cn.js +0 -6
- data/vendor/assets/javascripts/ckeditor/lang/zh.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/dialogs/a11yhelp.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/a11yhelp/lang/he.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/about.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/about/dialogs/logo_ckeditor.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/adobeair/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/ajax/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/autogrow/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/bbcode/plugin.js +0 -9
- data/vendor/assets/javascripts/ckeditor/plugins/clipboard/dialogs/paste.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/colordialog/dialogs/colordialog.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/devtools/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/dialog/dialogDefinition.js +0 -4
- data/vendor/assets/javascripts/ckeditor/plugins/div/dialogs/div.js +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/docprops/dialogs/docprops.js +0 -10
- data/vendor/assets/javascripts/ckeditor/plugins/docprops/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/find/dialogs/find.js +0 -10
- data/vendor/assets/javascripts/ckeditor/plugins/flash/dialogs/flash.js +0 -9
- data/vendor/assets/javascripts/ckeditor/plugins/flash/images/placeholder.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/button.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/checkbox.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/form.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/hiddenfield.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/radio.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/select.js +0 -9
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textarea.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/dialogs/textfield.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/forms/images/hiddenfield.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/dialogs/iframe.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/iframe/images/placeholder.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/iframedialog/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/image/dialogs/image.js +0 -13
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/anchor.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/link/dialogs/link.js +0 -12
- data/vendor/assets/javascripts/ckeditor/plugins/link/images/anchor.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/liststyle/dialogs/liststyle.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/pagebreak/images/pagebreak.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/pastefromword/filter/default.js +0 -11
- data/vendor/assets/javascripts/ckeditor/plugins/pastetext/dialogs/pastetext.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/dialogs/placeholder.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/lang/he.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/placeholder.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/placeholder/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/options.js +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/scayt/dialogs/toolbar.css +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_address.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_blockquote.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_div.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h1.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h2.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h3.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h4.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h5.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_h6.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_p.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/showblocks/images/block_pre.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/dialogs/smiley.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angel_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/angry_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/broken_heart.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/confused_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/cry_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/devil_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/embaressed_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/envelope.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/heart.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/kiss.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/lightbulb.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/omg_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/regular_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/sad_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/shades_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/teeth_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_down.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/thumbs_up.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/tounge_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/whatchutalkingabout_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/smiley/images/wink_smile.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/dialogs/specialchar.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/specialchar/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/styles/styles/default.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/stylesheetparser/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/table/dialogs/table.js +0 -9
- data/vendor/assets/javascripts/ckeditor/plugins/tableresize/plugin.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/tabletools/dialogs/tableCell.js +0 -8
- data/vendor/assets/javascripts/ckeditor/plugins/templates/dialogs/templates.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/default.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template1.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template2.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/templates/templates/images/template3.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/dialogs/uicolor.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/en.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/lang/he.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/uicolor.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_bg.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/hue_thumb.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_mask.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/picker_thumb.png +0 -0
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/assets/yui.css +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/uicolor/yui/yui.js +0 -76
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/ciframe.html +0 -49
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/tmpFrameset.html +0 -52
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.css +0 -6
- data/vendor/assets/javascripts/ckeditor/plugins/wsc/dialogs/wsc.js +0 -7
- data/vendor/assets/javascripts/ckeditor/plugins/xml/plugin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/skins/kama/dialog.css +0 -10
- data/vendor/assets/javascripts/ckeditor/skins/kama/editor.css +0 -13
- data/vendor/assets/javascripts/ckeditor/skins/kama/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/icons_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/images/dialog_sides.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/images/dialog_sides.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/images/dialog_sides_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/images/mini.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/images/noimage.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/images/sprites.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/images/sprites_ie6.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/images/toolbar_start.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/kama/skin.js +0 -7
- data/vendor/assets/javascripts/ckeditor/skins/kama/templates.css +0 -6
- data/vendor/assets/javascripts/ckeditor/skins/office2003/dialog.css +0 -9
- data/vendor/assets/javascripts/ckeditor/skins/office2003/editor.css +0 -14
- data/vendor/assets/javascripts/ckeditor/skins/office2003/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/icons_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/dialog_sides_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/mini.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/noimage.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/sprites.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/images/sprites_ie6.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/office2003/skin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/skins/office2003/templates.css +0 -6
- data/vendor/assets/javascripts/ckeditor/skins/v2/dialog.css +0 -9
- data/vendor/assets/javascripts/ckeditor/skins/v2/editor.css +0 -13
- data/vendor/assets/javascripts/ckeditor/skins/v2/icons.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/icons_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/dialog_sides.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/dialog_sides.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/dialog_sides_rtl.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/mini.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/noimage.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/sprites.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/sprites_ie6.png +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/images/toolbar_start.gif +0 -0
- data/vendor/assets/javascripts/ckeditor/skins/v2/skin.js +0 -6
- data/vendor/assets/javascripts/ckeditor/skins/v2/templates.css +0 -6
- data/vendor/assets/javascripts/ckeditor/themes/default/theme.js +0 -8
Binary file
|
Binary file
|
@@ -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
|
-
|
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
|
data/app/models/activity.rb
CHANGED
@@ -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
|
-
|
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!(:
|
235
|
+
sent_contacts.create!(:receiver => Actor.normalize(subject))
|
237
236
|
end
|
238
|
-
|
239
|
-
|
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
|
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
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
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
|
data/app/models/contact.rb
CHANGED
@@ -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
|
-
#
|
82
|
-
def
|
83
|
-
|
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}
|
88
|
-
#
|
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
|
-
|
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
|
-
<%=
|
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
|
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.
|
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.
|
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
|
-
|
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.
|
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
|
-
$(
|
15
|
-
|
16
|
-
|
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
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
}
|
15
|
-
|
16
|
-
|
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
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
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
|
-
|
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>
|