social_stream 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (41) hide show
  1. data/.gitignore +2 -0
  2. data/app/controllers/authentications_controller.rb +17 -0
  3. data/app/controllers/omniauth_callbacks_controller.rb +17 -0
  4. data/app/models/actor.rb +11 -1
  5. data/app/models/authentication.rb +3 -0
  6. data/app/models/permission.rb +81 -18
  7. data/app/models/relation.rb +21 -3
  8. data/app/models/tie.rb +38 -20
  9. data/app/models/user.rb +29 -0
  10. data/app/views/frontpage/_sponsor.html.erb +6 -6
  11. data/app/views/groups/index.html.erb +1 -1
  12. data/app/views/layouts/_header.erb +1 -1
  13. data/app/views/layouts/application.html.erb +3 -3
  14. data/app/views/users/_profile.html.erb +5 -3
  15. data/app/views/users/edit.html.erb +105 -114
  16. data/app/views/users/index.html.erb +7 -6
  17. data/bin/social_stream +0 -0
  18. data/bin/social_stream_heroku +76 -0
  19. data/config/locales/en.yml +1 -0
  20. data/config/routes.rb +1 -2
  21. data/lib/generators/social_stream/install_generator.rb +8 -0
  22. data/lib/generators/social_stream/templates/initializer.rb +2 -2
  23. data/lib/generators/social_stream/templates/migration.rb +15 -0
  24. data/lib/generators/social_stream/templates/public/stylesheets/browse.css +47 -5
  25. data/lib/generators/social_stream/templates/public/stylesheets/edit_user.css +32 -19
  26. data/lib/generators/social_stream/templates/public/stylesheets/index.css +25 -13
  27. data/lib/generators/social_stream/templates/public/stylesheets/jqcloud.css +2 -2
  28. data/lib/generators/social_stream/templates/public/stylesheets/users.css +0 -22
  29. data/lib/generators/social_stream/templates/relations.yml +25 -20
  30. data/lib/social_stream.rb +1 -1
  31. data/lib/social_stream/models/subject.rb +9 -1
  32. data/lib/social_stream/rails.rb +2 -0
  33. data/lib/social_stream/version.rb +1 -1
  34. data/social_stream.gemspec +4 -1
  35. data/spec/dummy/config/initializers/devise.rb +71 -40
  36. data/spec/dummy/config/initializers/social_stream.rb +2 -2
  37. data/spec/dummy/config/relations.yml +25 -20
  38. data/spec/dummy/script/rails +0 -0
  39. data/spec/models/activity_spec.rb +3 -3
  40. data/spec/models/tie_spec.rb +1 -1
  41. metadata +78 -24
@@ -20,18 +20,19 @@
20
20
 
21
21
  <div id="my_conferences">
22
22
  <div id="tabconference_browse" class="widget content_size">
23
- <ul class="tabconference_browse">
24
- <li>
25
- <a href="/users"><%= t('user.all')%> (<%=User.count%>) </a>
26
- </li>
27
- </ul>
23
+
28
24
  <div id="contacts" class="tabconference_browse">
29
25
  <div class="space_center">
30
26
  </div>
31
- <div><input type="text" value="Search by name" id="search_field" class="search_input" /><%= image_tag("btn/search.png",:size=>"20x20",:id=>"search_button") %></div>
27
+ <div class="search_field_wrapper"><input type="text" value="Search by name" id="search_field" class="search_input" /><%= image_tag("btn/search.png",:size=>"20x20",:id=>"search_button") %></div>
32
28
  <div class="space_center">
33
29
  </div>
34
30
  <div class="letters" class="content_size">
31
+ <ul class="tabconference_browse">
32
+ <li>
33
+ <%= link_to t('user.all_n', :count => User.count), users_path %>
34
+ </li>
35
+ </ul>
35
36
  <% for char in 'A'..'Z' %>
36
37
  <%= link_to char,{:letter => char,:page => 1},:class => "user_letter_link" %>
37
38
  <% end %>
data/bin/social_stream CHANGED
File without changes
@@ -0,0 +1,76 @@
1
+ #!/bin/bash
2
+ #Social_stream_heroku complete install
3
+ #Arguments:
4
+ #$1 --> Name of the folder to create the social_stream project
5
+ EXPECTED_ARGS=1
6
+
7
+ if [ $# -ne $EXPECTED_ARGS ]
8
+ then
9
+ echo "Usage: `basename $0` path/to/your/application"
10
+ exit 1
11
+ fi
12
+
13
+
14
+ #Linux packages
15
+ echo 'Installing Linux packages'
16
+ PACKAGES_COMMON='ruby ruby-dev rdoc irb libopenssl-ruby wget make curl aspell-es aspell-en libxml2-dev libxslt-dev libmagickcore-dev libmagickwand-dev libsqlite3-dev libmysqlclient-dev mysql-server rake git-core'
17
+ PACKAGES_PRODUCTION='awstats logrotate nfs-common'
18
+ sudo apt-get install $PACKAGES_COMMON
19
+ sudo apt-get install $PACKAGES_PRODUCTION
20
+ echo 'Done'
21
+
22
+ #Rubygems
23
+ RUBY_GEMS_VERSION='1.3.7'
24
+ RUBY_GEMS_PACKAGE="rubygems-"${RUBY_GEMS_VERSION}".tgz"
25
+ RUBY_GEMS_DOWNLOAD="http://rubyforge.org/frs/download.php/70696/"${RUBY_GEMS_PACKAGE}
26
+
27
+ echo 'Installing Rubygems $RUBY_GEMS_VERSION'
28
+
29
+ cd /tmp && wget $RUBY_GEMS_DOWNLOAD
30
+ cd /tmp && tar zxf $RUBY_GEMS_PACKAGE
31
+ cd /tmp/rubygems-$RUBY_GEMS_VERSION && sudo /usr/bin/ruby setup.rb
32
+
33
+ sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
34
+ echo 'Done'
35
+
36
+ #Gems
37
+ echo 'Installing Initial Gems'
38
+ sudo gem install rails
39
+ sudo gem install bundler
40
+ sudo gem install heroku
41
+ echo 'Done'
42
+
43
+ #Social Stream
44
+ echo 'Creating and Setting up your Social Stream basic application'
45
+ export PATH=$PATH:/var/lib/gems/1.8/bin
46
+ echo 'Creating rails project'
47
+ rails new $1
48
+ cd $1
49
+ echo 'gem "social_stream"' >> Gemfile
50
+ echo 'Updating bundle'
51
+ bundle update
52
+ echo 'Setting up the application'
53
+ rails generate social_stream:install -y
54
+ rake db:migrate
55
+ rake db:seed
56
+ echo 'Done'
57
+
58
+ #Git repository
59
+ echo 'Setting up your git repository'
60
+ git init
61
+ git add .
62
+ git commit -m 'first commit'
63
+ echo 'Done'
64
+
65
+ #Heroku deployment
66
+ echo '[!] Starting deploy to heroku, you will be asked your heroku username and password'
67
+ echo '[!] If you do not have one visit http://www.heroku.com'
68
+ echo '[!] You will also need properly configured SSH keys visit: '
69
+ echo '[!] http://help.github.com/linux-key-setup/'
70
+ read -p '[!] When both things are ready PRESS ANY KEY TO CONTINUE...'
71
+ heroku create
72
+ git push heroku master
73
+ heroku rake db:migrate
74
+ echo 'Done'
75
+
76
+ echo 'Instalation & deployment are now complete. Visit https://api.heroku.com/myapps'
@@ -99,4 +99,5 @@ en:
99
99
  one: "User"
100
100
  other: "Users"
101
101
  all: "All users"
102
+ all_n: "All users (%{count})"
102
103
 
data/config/routes.rb CHANGED
@@ -5,7 +5,7 @@ Rails.application.routes.draw do
5
5
  match 'home' => 'home#index', :as => :home
6
6
  match 'home' => 'home#index', :as => :user_root # devise after_sign_in_path_for
7
7
 
8
- devise_for :users
8
+ devise_for :users, :controllers => {:omniauth_callbacks => 'omniauth_callbacks'}
9
9
  resources :users
10
10
 
11
11
  resource :representation
@@ -26,5 +26,4 @@ Rails.application.routes.draw do
26
26
  resources :posts
27
27
  resources :comments
28
28
  resources :messages
29
-
30
29
  end
@@ -6,6 +6,14 @@ class SocialStream::InstallGenerator < Rails::Generators::Base #:nodoc:
6
6
 
7
7
  source_root File.expand_path('../templates', __FILE__)
8
8
 
9
+ def outh_for_devise_config
10
+ inject_into_file "config/initializers/devise.rb",
11
+ "\n config.omniauth :linked_in, \"ekxfXU8nueVSMQ9fc5KJAryBkyztUlCBYMW3DoQPzbE79WhivvzhQloRNHCHgPeB\", \"WYiHFT-KKFgjd45W3-pEAficmXRHmN6_6DGwj1C_ZILJlSO1gBvv6VNYXU9tybGY\"
12
+ \n config.omniauth :facebook, \"129571360447856\",\"eef39dce5e20e76f77495c59623bdb38\"
13
+ \n #config.omniauth :twitter, \"wgTxO0fTpjTeSnjKC9ZHA\",\"JepulVWwLcuAnGfWjwCu47yEP0TcJJfKtvISPBsilI\"",
14
+ :after => " # config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'"
15
+ end
16
+
9
17
  def create_initializer_file
10
18
  copy_file 'initializer.rb', 'config/initializers/social_stream.rb'
11
19
  end
@@ -8,8 +8,8 @@ SocialStream.setup do |config|
8
8
  # Others available are:
9
9
  # :token_authenticatable, :confirmable, :lockable, :timeoutable, :validatable
10
10
  # config.devise_modules :database_authenticatable, :registerable,
11
- # :recoverable, :rememberable, :trackable
12
-
11
+ # :recoverable, :rememberable, :trackable, :omniauthable
12
+
13
13
  # Type of activities managed by actors
14
14
  # Remember you must add an "activity_object_id" foreign key column to your migration!
15
15
  #
@@ -50,6 +50,15 @@ class CreateSocialStream < ActiveRecord::Migration
50
50
  add_index "actors", "email"
51
51
  add_index "actors", "permalink", :unique => true
52
52
 
53
+ create_table :authentications, :force => true do |t|
54
+ t.integer :user_id
55
+ t.string :provider
56
+ t.string :uid
57
+ t.timestamps
58
+ end
59
+
60
+ add_index "authentications", "user_id"
61
+
53
62
  create_table "comments", :force => true do |t|
54
63
  t.integer "activity_object_id"
55
64
  t.text "text"
@@ -206,6 +215,8 @@ class CreateSocialStream < ActiveRecord::Migration
206
215
 
207
216
  add_foreign_key "actors", "activity_objects", :name => "actors_on_activity_object_id"
208
217
 
218
+ add_foreign_key "authentications", "users", :name => "authentications_on_user_id"
219
+
209
220
  add_foreign_key "comments", "activity_objects", :name => "comments_on_activity_object_id"
210
221
 
211
222
  add_foreign_key "groups", "actors", :name => "groups_on_actor_id"
@@ -231,6 +242,7 @@ class CreateSocialStream < ActiveRecord::Migration
231
242
 
232
243
  add_foreign_key "users", "actors", :name => "users_on_actor_id"
233
244
  end
245
+
234
246
 
235
247
  def self.down
236
248
  remove_foreign_key "activities", :name => "index_activities_on_activity_verb_id"
@@ -240,6 +252,8 @@ class CreateSocialStream < ActiveRecord::Migration
240
252
 
241
253
  remove_foreign_key "actors", :name => "actors_on_activity_object_id"
242
254
 
255
+ remove_foreign_key "authentications", :name => "authentications_on_user_id"
256
+
243
257
  remove_foreign_key "comments", :name => "comments_on_activity_object_id"
244
258
 
245
259
  remove_foreign_key "groups", :name => "groups_on_actor_id"
@@ -270,6 +284,7 @@ class CreateSocialStream < ActiveRecord::Migration
270
284
  drop_table :activity_objects
271
285
  drop_table :activity_verbs
272
286
  drop_table :actors
287
+ drop_table :authentications
273
288
  drop_table :comments
274
289
  drop_table :groups
275
290
  drop_table :messages
@@ -2,11 +2,14 @@
2
2
  padding: 5px;
3
3
  }
4
4
  .post_browse{
5
- width:49%;
5
+ padding-left: 4%;
6
+ width:45%;
6
7
  display:inline-block;
8
+ margin-bottom: 10px;
7
9
  }
8
10
  .post_browse_title{
9
11
  font-weight:bold;
12
+ color: black;
10
13
  }
11
14
  .post_picture{
12
15
  display:inline-block;
@@ -41,7 +44,6 @@
41
44
 
42
45
 
43
46
  #tabconferences_browse {
44
-
45
47
  }
46
48
 
47
49
  .tabconference_browse {
@@ -52,7 +54,6 @@
52
54
 
53
55
  .tabconference_browse fondo {
54
56
 
55
- background-color: #deeff8;
56
57
  }
57
58
 
58
59
  .tabconference_browse li {
@@ -62,14 +63,13 @@
62
63
  }
63
64
 
64
65
  .tabconference_browse li a {
65
- background-color: #deeff8;
66
66
  text-decoration: none;
67
67
  padding: 4px 3px;
68
68
  outline: none;
69
+ float: left;
69
70
  }
70
71
 
71
72
  .tabconference_browse ul {
72
- background: #deeff8;
73
73
  }
74
74
 
75
75
  .tabconference_browse li a:hover,
@@ -117,4 +117,46 @@
117
117
  padding-top: 5px;
118
118
  }
119
119
 
120
+ .letters a {
121
+ padding-right: 5px;
122
+ }
123
+
124
+ #ajax_loader_icon, .pagination{
125
+ text-align:center;
126
+ padding-top: 20px;
127
+ }
128
+
129
+ .letters{
130
+ text-align:center;
131
+ padding-top: 10px;
132
+ padding-bottom: 10px;
133
+ }
134
+
135
+ .search_input{
136
+ border-color: #0656a4;
137
+ color: #2A3890;
138
+ margin-left: 5px;
139
+ padding: 2px 2px 2px 2px;
140
+ border:1px solid #BDC7D8;
141
+ }
142
+
143
+ #search_button{
144
+ cursor: pointer;
145
+ margin-top: 2px;
146
+ }
147
+
148
+ #my_conferences{
149
+ background-color:white;
150
+ }
151
+
152
+ .search_field_wrapper{
153
+ margin-top:20px;
154
+ width:100%;
155
+ text-align:left;
156
+ }
157
+
158
+ .search_field_wrapper input{
159
+ float: left;
160
+ }
161
+
120
162
 
@@ -2,7 +2,6 @@
2
2
 
3
3
  .contact_link{
4
4
  color: #4A58E0;
5
- text-align: center;
6
5
  text-decoration: underline;
7
6
  }
8
7
 
@@ -19,52 +18,66 @@
19
18
  color: #6C6D6F;
20
19
  }
21
20
 
22
- .info_left{
23
- float: left;
24
- }
25
-
26
- #personal_info {
27
- padding-right: 4px;
28
- padding-top: 30px;
29
- }
30
-
31
21
  /*Edit*/
22
+ button, .button{
23
+ margin-top:10px;
24
+ margin-left: 10px;
25
+ padding: 3px 3px 3px 3px;
26
+ color:#FFFFFF;
27
+ background-color: #1F4A75;
28
+ }
32
29
  .confirmed{
33
30
  color: #009933;
34
31
  padding-left: 5%;
35
32
  }
36
- .editField{
33
+
34
+ .edit_field{
37
35
  padding-top: 5px;
36
+ display: table;
37
+ margin-left: 10px;
38
+ }
39
+ .edit_label{
40
+ width: 75px;
41
+ display:table-cell;
42
+ }
43
+
44
+ .edit_text {
45
+ border-color: #0656a4;
46
+ padding: 2px 5px 2px 0px;
47
+ border:1px solid #BDC7D8;
48
+ font-size: 12px;
49
+ width: 200px;
38
50
  }
39
51
  .error{
40
52
  color: #A2042B;
41
53
  font-weight: bold;
42
54
  }
55
+
43
56
  .error_explanation{
44
57
  color: #A2042B;
45
58
  padding-left: 5%;
46
59
  }
60
+
47
61
  .section_highlight{
48
62
  border-left: none;
49
63
  border-bottom: thin solid #D4E4EA;
50
64
  border-top: thin solid #D4E4EA;
51
65
  border-right: thin solid #D4E4EA;
52
- }
53
- .section_normal{
54
- border-left: thin solid #D4E4EA;
55
- background-color: #EEF;
66
+ background-color: #EEF;
56
67
  }
57
68
 
58
- .sectionEdit{
69
+ .section_edit{
59
70
  border-bottom-color: #E1EEF5;
60
71
  border-bottom-style: solid;
61
- /*text-decoration: underline;*/
62
72
  font-weight: bold;
63
73
  font-size: 14px;
74
+ margin-bottom: 1%;
64
75
  }
65
76
  #user_profile_attributes_description, #user_profile_attributes_experience{
66
- width: 95% ;
67
- max-width: 95% ;
77
+ width: 275px;
78
+ max-width: 350px ;
79
+ display:block;
80
+ margin-top: 5px;
68
81
  }
69
82
 
70
83
 
@@ -1,6 +1,7 @@
1
1
  /********************************** body *******************************/
2
2
  #wrapper_body {
3
3
  width: 960px;
4
+ display: table;
4
5
  margin-left: auto;
5
6
  margin-right: auto;
6
7
  background-color: #fff;
@@ -33,7 +34,7 @@
33
34
  border-right: thin solid #D4E4EA;
34
35
  border-bottom: thin solid #D4E4EA;
35
36
  vertical-align: top;
36
- display: inline-block;
37
+ display: table-cell;
37
38
  padding-top: 10px;
38
39
  font-size: 14px;
39
40
  }
@@ -43,7 +44,7 @@
43
44
  border-right: thin solid #D4E4EA;
44
45
  border-bottom: thin solid #D4E4EA;
45
46
  vertical-align: top;
46
- display: inline-block;
47
+ display: table-cell;
47
48
  padding-top: 10px;
48
49
  font-size: 14px;
49
50
  }
@@ -52,30 +53,34 @@
52
53
  width: 255px;
53
54
  border-color: #000;
54
55
  vertical-align: top;
55
- display: inline-block;
56
+ display: table-cell;
56
57
  padding: 5px 5px 5px 0px;
57
- /*
58
- border-left: thin solid #D4E4EA;
59
- border-bottom: thin solid #D4E4EA;
60
- */
58
+ border-left: thin solid #D4E4EA;
59
+ border-bottom: thin solid #D4E4EA;
60
+
61
61
  }
62
62
 
63
63
  #middle {
64
64
  width: 220px;
65
- display: inline-block;
65
+ display: table-cell;
66
66
  vertical-align: top;
67
- border-bottom: thin solid #D4E4EA;
68
- /*border-right: thin solid #D4E4EA;*/
67
+ /*border-bottom: thin solid #D4E4EA;
68
+ border-left:thin solid #D4E4EA;
69
+ border-right: thin solid #D4E4EA;*/
69
70
  }
70
71
 
71
72
  #right {
72
73
  width: 160px;
73
74
  border-color: #000;
74
75
  vertical-align: top;
75
- display: inline-block;
76
+ display: table-cell;
76
77
  padding: 5px 5px 5px 5px;
78
+
79
+ }
80
+
81
+ #rightContent{
77
82
  border-left: thin solid #D4E4EA;
78
- border-bottom: thin solid #D4E4EA;
83
+ border-bottom: thin solid #D4E4EA;
79
84
  }
80
85
 
81
86
  #hiddenMiddle {
@@ -396,15 +401,22 @@
396
401
  }
397
402
 
398
403
  .info_post {
399
- display: block;
404
+ /* display: block;*/
400
405
  width: 100%;
401
406
  padding-top: 3px;
402
407
  padding-bottom: 2px;
403
408
  }
404
409
 
410
+ .info_center{
411
+ display: inline-block;
412
+ text-justify: auto;
413
+ color: #000;
414
+ }
415
+
405
416
  .info_left {
406
417
  display: inline-block;
407
418
  width: 35%;
419
+ float: left;
408
420
  }
409
421
 
410
422
  .info_right {