social_stream 0.3.6 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +1 -0
- data/Gemfile +6 -0
- data/app/controllers/api_controller.rb +39 -0
- data/app/controllers/frontpage_controller.rb +2 -0
- data/app/controllers/groups_controller.rb +8 -2
- data/app/controllers/likes_controller.rb +9 -29
- data/app/controllers/logos_controller.rb +21 -0
- data/app/controllers/mailbox/conversation_controller.rb +110 -0
- data/app/controllers/mailbox_controller.rb +35 -0
- data/app/controllers/posts_controller.rb +2 -0
- data/app/controllers/profiles_controller.rb +3 -0
- data/app/controllers/ties_controller.rb +10 -0
- data/app/controllers/users_controller.rb +5 -5
- data/app/helpers/groups_helper.rb +0 -2
- data/app/helpers/subjects_helper.rb +11 -0
- data/app/helpers/ties_helper.rb +1 -1
- data/app/models/activity.rb +24 -1
- data/app/models/activity_object.rb +10 -0
- data/app/models/activity_object_activity.rb +10 -0
- data/app/models/actor.rb +87 -60
- data/app/models/group.rb +10 -4
- data/app/models/like.rb +34 -0
- data/app/models/logo.rb +51 -0
- data/app/models/permission.rb +7 -5
- data/app/models/profile.rb +24 -8
- data/app/models/tie.rb +15 -2
- data/app/models/user.rb +2 -2
- data/app/views/activities/_activities.html.erb +1 -1
- data/app/views/activities/_new.html.erb +12 -7
- data/app/views/api/activity_atom_feed.atom.builder +40 -0
- data/app/views/comments/_new.html.erb +1 -1
- data/app/views/devise/passwords/edit.html.erb +21 -0
- data/app/views/devise/passwords/new.html.erb +16 -0
- data/app/views/devise/registrations/new.html.erb +35 -19
- data/app/views/devise/sessions/new.html.erb +30 -0
- data/app/views/frontpage/_header.html.erb +18 -20
- data/app/views/frontpage/_search.html.erb +13 -0
- data/app/views/frontpage/_sponsor.html.erb +12 -13
- data/app/views/frontpage/index.html.erb +88 -80
- data/app/views/groups/_group.html.erb +2 -6
- data/app/views/groups/_index.html.erb +22 -25
- data/app/views/groups/_logo.html.erb +1 -1
- data/app/views/groups/_new.html.erb +56 -39
- data/app/views/groups/_profile.html.erb +142 -0
- data/app/views/groups/_sidebar_index.html.erb +73 -0
- data/app/views/groups/{_middle_show.html.erb → _sidebar_show.html.erb} +2 -2
- data/app/views/groups/_tabs.html.erb +37 -31
- data/app/views/groups/_toolbar_show.html.erb +12 -0
- data/app/views/groups/edit.html.erb +136 -0
- data/app/views/groups/index.html.erb +47 -46
- data/app/views/groups/new.html.erb +2 -0
- data/app/views/groups/show.html.erb +9 -4
- data/app/views/groups/update.js.erb +39 -0
- data/app/views/home/_groups.html.erb +4 -5
- data/app/views/{users/_middle_index.html.erb → home/_sidebar.html.erb} +0 -2
- data/app/views/home/index.html.erb +3 -5
- data/app/views/layouts/_footer.html.erb +4 -0
- data/app/views/layouts/_header.erb +29 -37
- data/app/views/layouts/_representation.html.erb +2 -2
- data/app/views/layouts/application.html.erb +47 -74
- data/app/views/layouts/frontpage.html.erb +27 -48
- data/app/views/layouts/test.html +44 -0
- data/app/views/likes/create.js.erb +1 -1
- data/app/views/likes/destroy.js.erb +1 -1
- data/app/views/logos/_form.html.erb +33 -0
- data/app/views/logos/_precrop.html.erb +48 -0
- data/app/views/logos/edit.html.erb +6 -0
- data/app/views/logos/index.html.erb +27 -0
- data/app/views/logos/new.html.erb +20 -0
- data/app/views/logos/show.html.erb +5 -0
- data/app/views/mailbox/_conversation.html.erb +23 -0
- data/app/views/mailbox/_conversations.html.erb +9 -0
- data/app/views/mailbox/_index.html.erb +16 -0
- data/app/views/{messages → mailbox}/_location.html.erb +0 -0
- data/app/views/mailbox/_menu_options.html.erb +19 -0
- data/app/views/mailbox/_show.html.erb +15 -0
- data/app/views/mailbox/conversation/_conversation.html.erb +40 -0
- data/app/views/mailbox/conversation/_form.html.erb +54 -0
- data/app/views/mailbox/conversation/_location.html.erb +3 -0
- data/app/views/mailbox/conversation/_new.html.erb +19 -0
- data/app/views/mailbox/conversation/_show.html.erb +27 -0
- data/app/views/mailbox/conversation/edit.html.erb +6 -0
- data/app/views/mailbox/conversation/new.html.erb +10 -0
- data/app/views/mailbox/conversation/new.js.erb +1 -0
- data/app/views/mailbox/conversation/show.html.erb +1 -0
- data/app/views/{messages → mailbox}/edit.html.erb +0 -0
- data/app/views/mailbox/index.html.erb +10 -0
- data/app/views/{messages → mailbox}/index.js.erb +0 -0
- data/app/views/mailbox/new.html.erb +14 -0
- data/app/views/mailbox/show.html.erb +11 -0
- data/app/views/mailbox/show.js.erb +1 -0
- data/app/views/menu/_group.html.erb +15 -0
- data/{lib/generators/social_stream/templates/public/stylesheets/users.css → app/views/menu/_home_user.html.erb} +0 -0
- data/app/views/menu/_options.html.erb +11 -0
- data/app/views/menu/_services.html.erb +11 -0
- data/app/views/menu/_tiesGroup.html.erb +14 -0
- data/app/views/menu/_tiesUser.html.erb +11 -0
- data/app/views/menu/_user.html.erb +15 -0
- data/app/views/profiles/show.html.erb +1 -0
- data/app/views/subjects/_contacts.html.erb +8 -9
- data/app/views/subjects/_menu_options.html.erb +14 -0
- data/app/views/subjects/_toolbar.html.erb +15 -0
- data/app/views/ties/_new.html.erb +3 -2
- data/app/views/ties/_pendings.html.erb +7 -12
- data/app/views/ties/_suggestions.html.erb +12 -12
- data/app/views/ties/_tie.html.erb +9 -7
- data/app/views/ties/new.js.erb +1 -2
- data/app/views/users/_groups.html.erb +4 -3
- data/app/views/users/_index.html.erb +24 -22
- data/app/views/users/_logo.html.erb +1 -1
- data/app/views/users/_profile.html.erb +167 -164
- data/app/views/users/_sidebar_index.html.erb +6 -0
- data/app/views/users/{_middle_show.html.erb → _sidebar_show.html.erb} +0 -0
- data/app/views/users/_toolbar_show.html.erb +17 -0
- data/app/views/users/edit.html.erb +193 -165
- data/app/views/users/index.html.erb +34 -47
- data/{spec/dummy/public/stylesheets/.gitkeep → app/views/users/info.html.erb} +0 -0
- data/app/views/users/show.html.erb +4 -4
- data/app/views/users/show.xml.builder +28 -0
- data/app/views/users/update.js.erb +3 -1
- data/config/locales/en.yml +88 -9
- data/config/routes.rb +30 -14
- data/lib/generators/social_stream/install_generator.rb +8 -2
- data/lib/generators/social_stream/templates/migration.rb +75 -81
- data/lib/generators/social_stream/templates/public/images/{frontpage/facebook.png → btn/1-facebook.png} +0 -0
- data/lib/generators/social_stream/templates/public/images/btn/edit.png +0 -0
- data/lib/generators/social_stream/templates/public/images/btn/facebook.png +0 -0
- data/lib/generators/social_stream/templates/public/images/btn/linkedin.png +0 -0
- data/lib/generators/social_stream/templates/public/images/btn/twitter-follow-icon.png +0 -0
- data/lib/generators/social_stream/templates/public/images/btn/twitter.png +0 -0
- data/lib/generators/social_stream/templates/public/images/frontpage/collaborate.png +0 -0
- data/lib/generators/social_stream/templates/public/images/frontpage/meet.png +0 -0
- data/lib/generators/social_stream/templates/public/images/frontpage/share.png +0 -0
- data/lib/generators/social_stream/templates/public/images/icons/favicon.ico +0 -0
- data/lib/generators/social_stream/templates/public/images/logo.png +0 -0
- data/lib/generators/social_stream/templates/public/images/w3c_css.png +0 -0
- data/lib/generators/social_stream/templates/public/images/w3c_xhtml.png +0 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery-ui-1.8.4.custom.min.js +3 -3
- data/lib/generators/social_stream/templates/public/javascripts/jquery-ui-personalized-1.5.2.packed.js +1 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery-ui.min.js +3 -3
- data/lib/generators/social_stream/templates/public/javascripts/jquery.Jcrop.min.js +163 -0
- data/lib/generators/social_stream/templates/public/javascripts/jquery.fcbkcomplete.min.js +76 -76
- data/lib/generators/social_stream/templates/public/javascripts/jquery.min.js +156 -5
- data/lib/generators/social_stream/templates/public/javascripts/main.js +9 -0
- data/lib/generators/social_stream/templates/public/javascripts/menu-collapsed.js +42 -0
- data/lib/generators/social_stream/templates/public/javascripts/menu.js +1 -1
- data/lib/generators/social_stream/templates/public/javascripts/rails.js +30 -29
- data/lib/generators/social_stream/templates/public/javascripts/superfish.js +121 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/activities.css +72 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/base.css +150 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/carousel.css +23 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{fcbkComplete.css → default/fcbkComplete.css} +2 -2
- data/lib/generators/social_stream/templates/public/stylesheets/default/footer.css +25 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/frontpage.css +54 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/header.css +44 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/home.css +44 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-icons_454545_256x240.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-icons_888888_256x240.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{images → default/images}/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/jqcloud.css +15 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{jquery-ui.css → default/jquery-ui.css} +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/jquery.Jcrop.css +35 -0
- data/lib/generators/social_stream/templates/public/stylesheets/default/menu.css +33 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-bg_flat_0_aaaaaa_40x100.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-bg_flat_75_ffffff_40x100.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-bg_glass_55_fbf9ee_1x400.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-bg_glass_65_ffffff_1x400.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-bg_glass_75_dadada_1x400.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-bg_glass_75_e6e6e6_1x400.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-bg_glass_95_fef1ec_1x400.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-bg_highlight-soft_75_cccccc_1x100.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-icons_222222_256x240.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-icons_2e83ff_256x240.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-icons_454545_256x240.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-icons_888888_256x240.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/images/ui-icons_cd0a0a_256x240.png +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/jquery-ui-1.7.3.custom.css +0 -0
- data/lib/generators/social_stream/templates/public/stylesheets/{smoothness → default/smoothness}/jquery-ui-1.8.4.custom.css +0 -0
- data/lib/social_stream.rb +11 -2
- data/lib/social_stream/ability.rb +21 -3
- data/lib/social_stream/models/object.rb +5 -3
- data/lib/social_stream/models/subject.rb +50 -31
- data/lib/social_stream/rails.rb +5 -0
- data/lib/social_stream/test_helpers.rb +11 -0
- data/lib/social_stream/test_helpers/controllers.rb +64 -0
- data/lib/social_stream/version.rb +1 -1
- data/lib/tasks/db/populate.rake +110 -25
- data/social_stream.gemspec +7 -1
- data/spec/controllers/contacts_controller_spec.rb +1 -1
- data/spec/controllers/groups_controller_spec.rb +8 -0
- data/spec/controllers/home_controller_spec.rb +15 -0
- data/spec/controllers/likes_controller_spec.rb +29 -0
- data/spec/controllers/posts_controller_spec.rb +41 -0
- data/spec/controllers/profiles_controller_spec.rb +46 -0
- data/spec/controllers/users_controller_spec.rb +2 -2
- data/spec/dummy/.gitignore +4 -0
- data/spec/dummy/config/database.yml +8 -0
- data/spec/dummy/config/environments/test_pg.rb +35 -0
- data/spec/dummy/config/routes.rb +2 -0
- data/spec/factories/group.rb +1 -1
- data/spec/integration/navigation_spec.rb +1 -1
- data/spec/models/actor_spec.rb +4 -4
- data/spec/models/user_spec.rb +2 -2
- data/spec/spec_helper.rb +1 -1
- data/spec/support/db.rb +7 -0
- metadata +198 -116
- data/app/controllers/messages_controller.rb +0 -3
- data/app/models/message.rb +0 -2
- data/app/views/groups/_middle_index.html.erb +0 -74
- data/app/views/groups/_right_index.html.erb +0 -19
- data/app/views/groups/_right_show.html.erb +0 -8
- data/app/views/home/_middle.html.erb +0 -4
- data/app/views/home/_options.html.erb +0 -8
- data/app/views/home/_right.html.erb +0 -17
- data/app/views/messages/_form.html.erb +0 -24
- data/app/views/messages/_index.html.erb +0 -24
- data/app/views/messages/_message.html.erb +0 -17
- data/app/views/messages/_messages.html.erb +0 -2
- data/app/views/messages/index.html.erb +0 -1
- data/app/views/messages/new.html.erb +0 -14
- data/app/views/messages/show.html.erb +0 -21
- data/app/views/users/_menu.html.erb +0 -7
- data/app/views/users/_options.html.erb +0 -5
- data/app/views/users/_right_index.html.erb +0 -19
- data/app/views/users/_right_show.html.erb +0 -14
- data/lib/generators/social_stream/templates/public/images/btn/btn_share.png +0 -0
- data/lib/generators/social_stream/templates/public/images/favicon.ico +0 -0
- data/lib/generators/social_stream/templates/public/images/frontpage/collaborate.gif +0 -0
- data/lib/generators/social_stream/templates/public/images/frontpage/meet.gif +0 -0
- data/lib/generators/social_stream/templates/public/images/frontpage/share.gif +0 -0
- data/lib/generators/social_stream/templates/public/javascripts/hoverIntent.js +0 -84
- data/lib/generators/social_stream/templates/public/stylesheets/activities.css +0 -235
- data/lib/generators/social_stream/templates/public/stylesheets/base.css +0 -68
- data/lib/generators/social_stream/templates/public/stylesheets/boxy.css +0 -49
- data/lib/generators/social_stream/templates/public/stylesheets/browse.css +0 -162
- data/lib/generators/social_stream/templates/public/stylesheets/carousel.css +0 -57
- data/lib/generators/social_stream/templates/public/stylesheets/edit_user.css +0 -104
- data/lib/generators/social_stream/templates/public/stylesheets/frontpage.css +0 -708
- data/lib/generators/social_stream/templates/public/stylesheets/header.css +0 -116
- data/lib/generators/social_stream/templates/public/stylesheets/home.css +0 -121
- data/lib/generators/social_stream/templates/public/stylesheets/index.css +0 -625
- data/lib/generators/social_stream/templates/public/stylesheets/jqcloud.css +0 -62
- data/lib/generators/social_stream/templates/public/stylesheets/menu.css +0 -83
- data/lib/generators/social_stream/templates/public/stylesheets/message.css +0 -46
- data/lib/generators/social_stream/templates/public/stylesheets/middle.css +0 -113
- data/lib/generators/social_stream/templates/public/stylesheets/right.css +0 -58
- data/lib/generators/social_stream/templates/public/stylesheets/social_stream.css +0 -78
- data/lib/generators/social_stream/templates/public/stylesheets/ui.dropdownchecklist.css +0 -21
- data/spec/dummy/db/.gitignore +0 -2
- data/spec/dummy/log/.gitignore +0 -1
- data/spec/dummy/public/javascripts/application.js +0 -2
- data/spec/dummy/public/javascripts/controls.js +0 -965
- data/spec/dummy/public/javascripts/dragdrop.js +0 -974
- data/spec/dummy/public/javascripts/effects.js +0 -1123
- data/spec/dummy/public/javascripts/prototype.js +0 -6001
- data/spec/dummy/public/javascripts/rails.js +0 -175
data/app/models/permission.rb
CHANGED
|
@@ -8,13 +8,14 @@
|
|
|
8
8
|
# the permissions assigned to {Relation} of the {Tie} she has just established.
|
|
9
9
|
#
|
|
10
10
|
# For example, when _Alice_ establishes a _friend_ tie to _Bob_, she is granting
|
|
11
|
-
# him the permissions associated with her _friend_ relation.
|
|
11
|
+
# him the permissions associated with her _friend_ relation. Alice's _friend_ relation may
|
|
12
|
+
# have different permissions from Bob's _friend_ relation.
|
|
12
13
|
#
|
|
13
14
|
# = Permissions description
|
|
14
15
|
#
|
|
15
16
|
# Permissions are composed by *action*, *objective* and *function*. Action and objective
|
|
16
17
|
# are typical in content management systems, e.g. <tt>create activity</tt>,
|
|
17
|
-
# <tt>update tie</tt>, <tt>read post</tt
|
|
18
|
+
# <tt>update tie</tt>, <tt>read post</tt>. *function* is a new parameter for social networks
|
|
18
19
|
#
|
|
19
20
|
# == Actions
|
|
20
21
|
#
|
|
@@ -24,8 +25,8 @@
|
|
|
24
25
|
# +read+:: view something
|
|
25
26
|
# +update+:: modify something
|
|
26
27
|
# +destroy+:: delete something
|
|
27
|
-
# +follow+::
|
|
28
|
-
# +represent+:: give the receiver rights to act as if he were
|
|
28
|
+
# +follow+:: subscribe to activity updates from the receiver of the tie
|
|
29
|
+
# +represent+:: give the receiver rights to act as if he were me.
|
|
29
30
|
#
|
|
30
31
|
# == Objectives
|
|
31
32
|
#
|
|
@@ -46,7 +47,8 @@
|
|
|
46
47
|
#
|
|
47
48
|
# Example: if the _friend_ relation has the permission
|
|
48
49
|
# <tt>create activity tie</tt>, the _friend_ can create activities
|
|
49
|
-
# attached to this tie only.
|
|
50
|
+
# attached to this tie only. _Bob_ can create activities only at _Alice_'s
|
|
51
|
+
# _friend_ level.
|
|
50
52
|
#
|
|
51
53
|
# +weak_ties+:: apply the permission to all the related ties with a relation weaker
|
|
52
54
|
# or equal than this. When a subject establishes a strong ties,
|
data/app/models/profile.rb
CHANGED
|
@@ -1,29 +1,45 @@
|
|
|
1
1
|
class Profile < ActiveRecord::Base
|
|
2
2
|
belongs_to :actor
|
|
3
3
|
|
|
4
|
+
validates_presence_of :actor_id
|
|
5
|
+
|
|
4
6
|
validates_format_of :mobile, :phone, :fax,
|
|
5
7
|
:allow_nil => true,
|
|
6
8
|
:with => /(^$)|(((\((\+?)\d+\))?|(\+\d+)?)[ ]*-?(\d+[ ]*\-?[ ]*\d*)+$)/,
|
|
7
9
|
:message => "has a invalid format"
|
|
8
|
-
|
|
10
|
+
|
|
9
11
|
validates_format_of :website,
|
|
10
12
|
:allow_nil => true,
|
|
11
13
|
:with => /(^$)|((https?|ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$)/ ,
|
|
12
14
|
:message => "has a invalid format"
|
|
13
|
-
|
|
15
|
+
|
|
14
16
|
validate :validate_birthday
|
|
15
17
|
|
|
16
|
-
def birthday=(value)
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
def birthday=(value)
|
|
19
|
+
if value.blank?
|
|
20
|
+
@birthday_formatted_invalid = false
|
|
21
|
+
super value
|
|
22
|
+
else
|
|
23
|
+
begin
|
|
24
|
+
super Date.parse(value)
|
|
25
|
+
@birthday_formatted_invalid = false
|
|
26
|
+
rescue
|
|
27
|
+
@birthday_formatted_invalid = true
|
|
28
|
+
end
|
|
29
|
+
end
|
|
21
30
|
end
|
|
22
31
|
|
|
32
|
+
# The subject of this profile
|
|
33
|
+
def subject
|
|
34
|
+
actor.try(:subject)
|
|
35
|
+
end
|
|
23
36
|
|
|
37
|
+
private
|
|
38
|
+
|
|
24
39
|
def validate_birthday
|
|
25
|
-
errors.add(:birthday, "is invalid. Please, use \"month/day/year\" format and make sure you choose a valid date" ) if @birthday_formatted_invalid || (birthday.present? && birthday > Date.today)
|
|
40
|
+
errors.add(:birthday, "is invalid. Please, use \"month/day/year\" format and make sure you choose a valid date" ) if (@birthday_formatted_invalid) || (birthday.present? && !birthday.blank? && birthday > Date.today)
|
|
26
41
|
end
|
|
42
|
+
|
|
27
43
|
|
|
28
44
|
|
|
29
45
|
end
|
data/app/models/tie.rb
CHANGED
|
@@ -34,6 +34,8 @@
|
|
|
34
34
|
#
|
|
35
35
|
# = Scopes
|
|
36
36
|
# There are several scopes defined:
|
|
37
|
+
#
|
|
38
|
+
# original:: ties created by actors. It excludes ties created in the weaker set.
|
|
37
39
|
# sent_by(actor):: ties whose sender is actor
|
|
38
40
|
# received_by(actor):: ties whose receiver is actor
|
|
39
41
|
# sent_or_received_by(actor):: the union of the former
|
|
@@ -60,6 +62,8 @@ class Tie < ActiveRecord::Base
|
|
|
60
62
|
has_many :tie_activities, :dependent => :destroy
|
|
61
63
|
has_many :activities, :through => :tie_activities
|
|
62
64
|
|
|
65
|
+
scope :original, where(:original => true)
|
|
66
|
+
|
|
63
67
|
scope :recent, order("#{ quoted_table_name }.created_at DESC")
|
|
64
68
|
|
|
65
69
|
scope :sent_by, lambda { |a|
|
|
@@ -96,6 +100,7 @@ class Tie < ActiveRecord::Base
|
|
|
96
100
|
before_validation :find_relation
|
|
97
101
|
|
|
98
102
|
after_create :complete_weak_set
|
|
103
|
+
after_create :create_activity_after_add_contact
|
|
99
104
|
|
|
100
105
|
def relation_name
|
|
101
106
|
@relation_name || relation.try(:name)
|
|
@@ -233,15 +238,23 @@ class Tie < ActiveRecord::Base
|
|
|
233
238
|
end
|
|
234
239
|
|
|
235
240
|
# After create callback
|
|
236
|
-
# Creates ties with
|
|
241
|
+
# Creates ties with weaker relations in the strength hierarchy of this tie
|
|
237
242
|
def complete_weak_set
|
|
238
243
|
return if reflexive?
|
|
239
244
|
|
|
240
245
|
relation.weaker.each do |r|
|
|
241
246
|
if relation_set(:relations => r).blank?
|
|
242
|
-
t = relation_set.build :relation => r
|
|
247
|
+
t = relation_set.build :relation => r,
|
|
248
|
+
:original => false
|
|
243
249
|
t.save!
|
|
244
250
|
end
|
|
245
251
|
end
|
|
246
252
|
end
|
|
253
|
+
|
|
254
|
+
|
|
255
|
+
def create_activity_after_add_contact
|
|
256
|
+
|
|
257
|
+
end
|
|
258
|
+
|
|
259
|
+
|
|
247
260
|
end
|
data/app/models/user.rb
CHANGED
|
@@ -46,7 +46,7 @@ class User < ActiveRecord::Base
|
|
|
46
46
|
end
|
|
47
47
|
|
|
48
48
|
class << self
|
|
49
|
-
%w( email
|
|
49
|
+
%w( email slug name ).each do |a|
|
|
50
50
|
eval <<-EOS
|
|
51
51
|
def find_by_#{ a }(#{ a }) # def find_by_email(email)
|
|
52
52
|
find :first, # find(:first,
|
|
@@ -64,7 +64,7 @@ class User < ActiveRecord::Base
|
|
|
64
64
|
if login =~ /@/
|
|
65
65
|
find_by_email(login)
|
|
66
66
|
else
|
|
67
|
-
|
|
67
|
+
find_by_slug(login)
|
|
68
68
|
end
|
|
69
69
|
else
|
|
70
70
|
super
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<% content_for :
|
|
1
|
+
<% content_for :headers, stylesheet_link_tag("activities", :media => "screen, projection") %>
|
|
2
2
|
<% content_for :javascript do %>
|
|
3
3
|
<%= render :partial => 'activities/jquery' %>
|
|
4
4
|
<% end -%>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
<% if receiver.
|
|
1
|
+
<% if receiver.active_ties_for(current_subject).any? %>
|
|
2
2
|
<% content_for :javascript do %>
|
|
3
|
+
|
|
3
4
|
securityImage = "<%= escape_javascript(image_tag('btn/btn_security.png', :id => 'security_image', :alt => 'security')) %>";
|
|
4
5
|
downImage = "<%= escape_javascript(image_tag('btn/btn_down.png')) %>";
|
|
5
6
|
|
|
@@ -10,15 +11,19 @@
|
|
|
10
11
|
|
|
11
12
|
<div id="activities_header" class="content_size">
|
|
12
13
|
<%= form_for Post.new(:text => t('activity.input'),
|
|
13
|
-
:_activity_tie_id => receiver.
|
|
14
|
+
:_activity_tie_id => receiver.active_ties_for(current_subject).first.id),
|
|
14
15
|
:remote => true do |f| %>
|
|
15
|
-
<%= f.hidden_field :_activity_tie_id %>
|
|
16
16
|
<%= f.text_field :text, :id => "input_activities", :size => 85 %>
|
|
17
17
|
<div id="activities_share_btn">
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
18
|
+
|
|
19
|
+
<% if receiver.active_ties_for(current_subject).count > 1 %>
|
|
20
|
+
<div id="securities">
|
|
21
|
+
<%= f.select :_activity_tie_id, receiver.active_ties_for(current_subject).sort{ |t, u| t.relation <=> u.relation }.map{ |t| [ t.relation_name, t.id ] }, {}, :id => 'security' %>
|
|
22
|
+
</div>
|
|
23
|
+
<% else %>
|
|
24
|
+
<%= f.hidden_field :_activity_tie_id %>
|
|
25
|
+
<% end %>
|
|
26
|
+
<%= f.submit t('share'), :class =>"myButtonBlue" %>
|
|
22
27
|
</div>
|
|
23
28
|
<% end -%>
|
|
24
29
|
</div>
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
atom_feed({'xmlns:activity' => 'http://activitystrea.ms/spec/1.0/'}) do |feed|
|
|
2
|
+
feed.title(@user.name + ' public stream')
|
|
3
|
+
feed.updated(@activities.first.updated_at)
|
|
4
|
+
feed.author do
|
|
5
|
+
feed.name(@user.name)
|
|
6
|
+
end
|
|
7
|
+
|
|
8
|
+
for activity in @activities
|
|
9
|
+
feed.entry(activity) do |entry|
|
|
10
|
+
#Atom compliant for not ActivityStream readers
|
|
11
|
+
entry.title('Activity')
|
|
12
|
+
entry.summary(activity.direct_object.text)
|
|
13
|
+
|
|
14
|
+
#ActivityStream compliant
|
|
15
|
+
|
|
16
|
+
entry.author do |a|
|
|
17
|
+
a.name(activity.sender_subject.name)
|
|
18
|
+
a.tag!('activity:object-type','person')
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
entry.tag!('activity:verb',activity.activity_verb.name)
|
|
22
|
+
|
|
23
|
+
entry.tag!('activity:object') do |act_ob|
|
|
24
|
+
act_ob.title('Activity')
|
|
25
|
+
act_ob.tag!('activity:object-type','status')
|
|
26
|
+
act_ob.publised(activity.created_at)
|
|
27
|
+
end
|
|
28
|
+
|
|
29
|
+
entry.content(activity.direct_object.text,:type=>'text/html')
|
|
30
|
+
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
feed.link :rel => 'self', :href=>request.url
|
|
35
|
+
feed.link :rel => 'next', :href=>api_my_home_url+'?page='+(params[:page].to_i+1).to_s
|
|
36
|
+
|
|
37
|
+
if params[:page].to_i != 1
|
|
38
|
+
feed.link :rel => 'previous', :href=>api_my_home_url+'?page='+(params[:page].to_i-1).to_s
|
|
39
|
+
end
|
|
40
|
+
end
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<%= f.text_field :text, :class =>"input_new_comments" %>
|
|
11
11
|
<div class="activities_comment_btn">
|
|
12
12
|
<div class="activities_security"></div>
|
|
13
|
-
<%=
|
|
13
|
+
<%= f.submit t('share'), :class =>"myButtonBlue" %>
|
|
14
14
|
</div>
|
|
15
15
|
<% end %>
|
|
16
16
|
</div>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<div id="login">
|
|
2
|
+
<h2><%= t('password.update') %></h2>
|
|
3
|
+
<div class="space_height">
|
|
4
|
+
</div>
|
|
5
|
+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :put }) do |f| %>
|
|
6
|
+
<%= devise_error_messages! %>
|
|
7
|
+
<%= f.hidden_field :reset_password_token %>
|
|
8
|
+
<div class="line">
|
|
9
|
+
<div class="label"><%= f.label t('password.default') %></div>
|
|
10
|
+
<div class="field"><%= f.password_field :password, :class =>"field_x" %></div>
|
|
11
|
+
</div>
|
|
12
|
+
<div class="line">
|
|
13
|
+
<div class="label"><%= f.label t('password.confirmation') %></div>
|
|
14
|
+
<div class="field"><%= f.password_field :password_confirmation, :class =>"field_x" %></div>
|
|
15
|
+
</div>
|
|
16
|
+
<div class="space_height"></div>
|
|
17
|
+
<div class="btn_login">
|
|
18
|
+
<%= f.submit "Change my password", :class =>"myButtonLarge" %>
|
|
19
|
+
</div>
|
|
20
|
+
<% end %>
|
|
21
|
+
</div>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
<div id="welcome">
|
|
2
|
+
<div id="login" class="block">
|
|
3
|
+
<h2><%= t('password.forgot') %></h2>
|
|
4
|
+
<div class="space_center"></div>
|
|
5
|
+
<div class="space_center"></div>
|
|
6
|
+
<%= form_for(resource, :as => resource_name, :url => password_path(resource_name), :html => { :method => :post }) do |f| %>
|
|
7
|
+
<%= devise_error_messages! %>
|
|
8
|
+
<div class="form_row"><%=t('devise.passwords.field') %></div>
|
|
9
|
+
<div class="form_row"><%= f.text_field :email %></div>
|
|
10
|
+
<div class="space_center"></div>
|
|
11
|
+
<div class="btn_login">
|
|
12
|
+
<%= f.submit t('action.send'), :class =>"myButton" %>
|
|
13
|
+
</div>
|
|
14
|
+
<% end %>
|
|
15
|
+
</div>
|
|
16
|
+
</div>
|
|
@@ -1,21 +1,37 @@
|
|
|
1
|
-
<
|
|
1
|
+
<div id="welcome">
|
|
2
|
+
<div id="login" class="block">
|
|
3
|
+
<h2><%= t('sign_in').capitalize %></h2>
|
|
4
|
+
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
|
|
5
|
+
<%= devise_error_messages! %>
|
|
6
|
+
<div class="form_row">
|
|
7
|
+
<div class="form_label"><%= f.label :name %></div>
|
|
8
|
+
<div class="form_field"><%= f.text_field :name, :class =>"field_x" %></div>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="form_row">
|
|
11
|
+
<div class="form_label"><%= f.label :email %></div>
|
|
12
|
+
<div class="form_field"><%= f.text_field :email, :class =>"field_x" %></div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="form_row">
|
|
15
|
+
<div class="form_label"><%= f.label :password %></div>
|
|
16
|
+
<div class="form_field"><%= f.password_field :password, :class =>"field_x", :id => "password" %></div>
|
|
17
|
+
</div>
|
|
18
|
+
<div class="form_row">
|
|
19
|
+
<div class="form_label"><%= f.label :password_confirmation %></div>
|
|
20
|
+
<div class="form_field"><%= f.password_field :password_confirmation, :class =>"field_x" %></div>
|
|
21
|
+
</div>
|
|
22
|
+
<div class="form_row center">
|
|
23
|
+
<div id="btn_login"><%= f.submit t('action.accept').capitalize,:class=>"myButton" %></div>
|
|
24
|
+
</div>
|
|
25
|
+
<% end %>
|
|
26
|
+
<div class="form_row center">
|
|
27
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
|
28
|
+
<%= link_to t('confirmation.not_received.long'), new_confirmation_path(resource_name) %><br />
|
|
29
|
+
<% end -%>
|
|
30
|
+
</div>
|
|
31
|
+
<div class="form_row center">
|
|
32
|
+
<%= render :partial => "devise/shared/links" %>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</div>
|
|
2
36
|
|
|
3
|
-
<%= form_for(resource, :as => resource_name, :url => registration_path(resource_name)) do |f| %>
|
|
4
|
-
<%= devise_error_messages! %>
|
|
5
37
|
|
|
6
|
-
<p><%= f.label :name %><br />
|
|
7
|
-
<%= f.text_field :name %></p>
|
|
8
|
-
|
|
9
|
-
<p><%= f.label :email %><br />
|
|
10
|
-
<%= f.text_field :email %></p>
|
|
11
|
-
|
|
12
|
-
<p><%= f.label :password %><br />
|
|
13
|
-
<%= f.password_field :password %></p>
|
|
14
|
-
|
|
15
|
-
<p><%= f.label :password_confirmation %><br />
|
|
16
|
-
<%= f.password_field :password_confirmation %></p>
|
|
17
|
-
|
|
18
|
-
<p><%= f.submit "Sign up" %></p>
|
|
19
|
-
<% end %>
|
|
20
|
-
|
|
21
|
-
<%= render :partial => "devise/shared/links" %>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
<div id="welcome">
|
|
4
|
+
<div id="login" class="block">
|
|
5
|
+
<h2><%= t('sign_in') %></h2>
|
|
6
|
+
<div class="space_center"></div>
|
|
7
|
+
<div class="space_center"></div>
|
|
8
|
+
<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
|
|
9
|
+
<%= devise_error_messages! %>
|
|
10
|
+
<div class="form_row">
|
|
11
|
+
<div class="form_label"><%= f.label :email %></div>
|
|
12
|
+
<div class="form_field"><%= f.email_field :email %></div>
|
|
13
|
+
</div>
|
|
14
|
+
<div class="form_row">
|
|
15
|
+
<div class="form_label"><%= f.label :password %></div>
|
|
16
|
+
<div class="form_field"><%= f.password_field :password %></div>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<div class="form_row">
|
|
20
|
+
<% if devise_mapping.rememberable? -%>
|
|
21
|
+
<p><%= f.check_box :remember_me %> <%= f.label :remember_me %></p>
|
|
22
|
+
<% end -%>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
<div class="btn_login">
|
|
26
|
+
<%= f.submit t('action.send'), :class =>"myButton" %>
|
|
27
|
+
</div>
|
|
28
|
+
<% end %>
|
|
29
|
+
</div>
|
|
30
|
+
</div>
|
|
@@ -1,23 +1,21 @@
|
|
|
1
|
-
<div id="
|
|
2
|
-
|
|
3
|
-
<
|
|
4
|
-
<div id="espacio_header">
|
|
5
|
-
 
|
|
6
|
-
</div>
|
|
1
|
+
<div id="headerFront">
|
|
2
|
+
<div class="banner_top">
|
|
3
|
+
<div id="logo"><%= link_to(image_tag('/images/logo.png', :alt => t('socialstream')), '/'); %></div>
|
|
7
4
|
<div class="div_login">
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
5
|
+
<%= form_for User.new, :as => :user, :url => user_session_path do |f| -%>
|
|
6
|
+
<span><%= f.label :email %></span>
|
|
7
|
+
<%= f.email_field :email, :class => "input_username" %>
|
|
8
|
+
<span><%= f.label :password %></span>
|
|
9
|
+
<%= f.password_field :password, :class => "input_username" %>
|
|
10
|
+
<%= f.submit t(:sign_in), :class => 'other_blue'%>
|
|
11
|
+
<% end -%>
|
|
12
|
+
<div class="subtexto">
|
|
13
|
+
<%= link_to t('sign_in'), new_user_registration_path, :class => "register_link" %>
|
|
14
|
+
<span>|</span>
|
|
15
|
+
<%= link_to t('forgot_password'), new_user_password_path, :class => "register_link" %>
|
|
16
|
+
</div>
|
|
20
17
|
</div>
|
|
21
|
-
|
|
22
|
-
</div>
|
|
18
|
+
<br class="clearfloat" />
|
|
19
|
+
</div>
|
|
23
20
|
</div>
|
|
21
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<div class="div_busqueda menu_list">
|
|
2
|
+
<ul>
|
|
3
|
+
<li>
|
|
4
|
+
<%= link_to t('browse'), users_path %>
|
|
5
|
+
</li>
|
|
6
|
+
</ul>
|
|
7
|
+
<div id="form_busqueda">
|
|
8
|
+
<%= form_tag(users_path, :method => "get") do -%>
|
|
9
|
+
<%=text_field_tag'search' %>
|
|
10
|
+
<%=submit_tag(t('find'), :class => 'other_blue') %>
|
|
11
|
+
<% end %>
|
|
12
|
+
</div>
|
|
13
|
+
</div>
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
<div id="sponsor">
|
|
2
|
-
<
|
|
3
|
-
<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
</
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
<div id="sponsor-wrapper">
|
|
2
|
+
<div id="sponsor">
|
|
3
|
+
<ul>
|
|
4
|
+
<li>
|
|
5
|
+
<%=link_to("DIT","http://www.dit.upm.es/")%> -
|
|
6
|
+
<%=link_to("UPM","http://www.upm.es/")%> &
|
|
7
|
+
<%=link_to("CISE","http://www.cise.espol.edu.ec/")%> -
|
|
8
|
+
<%=link_to("ESPOL","http://www.espol.edu.ec/")%>
|
|
9
|
+
</li>
|
|
10
|
+
</ul>
|
|
11
|
+
</div>
|
|
12
|
+
</div>
|