social_stream-base 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,4 @@
1
+ //= require search
1
2
  //= require hoverIntent
2
3
  //= require superfish
3
4
  //
@@ -0,0 +1 @@
1
+
@@ -48,7 +48,7 @@ input.other_blue{ background:#497FC1; border:0px; cursor:pointer; font-size:1.0
48
48
  margin-right:4px; color:white; padding:1px;}
49
49
  textarea.new_contact_text_area{ height: 100px; color: #2A3890;}
50
50
  .colum_field_title{ text-align: center; }
51
- .needed{color:#D8000C;font-weight: normal;}
51
+ .needed{color:#6C6D6F;font-weight: normal;}
52
52
  .select_relations select{ font-size: 12px; color: white; background-color:#1F4A75;}
53
53
 
54
54
  /************ Forms - Buttons SECTION ***************************/
@@ -9,7 +9,7 @@ class ContactsController < ApplicationController
9
9
  Contact.sent_by(current_subject).
10
10
  joins(:receiver).merge(Actor.alphabetic).
11
11
  merge(Actor.letter(params[:letter])).
12
- merge(Actor.search(params[:search])).
12
+ merge(Actor.name_search(params[:search])).
13
13
  active
14
14
 
15
15
  respond_to do |format|
@@ -11,7 +11,7 @@ class GroupsController < InheritedResources::Base
11
11
  @groups = Group.most(params[:most]).
12
12
  alphabetic.
13
13
  letter(params[:letter]).
14
- search(params[:search]).
14
+ name_search(params[:search]).
15
15
  tagged_with(params[:tag]).
16
16
  page(params[:page]).per(10)
17
17
 
@@ -6,7 +6,7 @@ class UsersController < InheritedResources::Base
6
6
  def index
7
7
  @users = User.alphabetic.
8
8
  letter(params[:letter]).
9
- search(params[:search]).
9
+ name_search(params[:search]).
10
10
  tagged_with(params[:tag]).
11
11
  page(params[:page]).per(10)
12
12
 
data/app/models/actor.rb CHANGED
@@ -21,6 +21,14 @@ class Actor < ActiveRecord::Base
21
21
 
22
22
  acts_as_messageable
23
23
 
24
+ define_index do
25
+ indexes name, :sortable => true
26
+ indexes email
27
+ indexes slug
28
+
29
+ has created_at
30
+ end
31
+
24
32
  acts_as_url :name, :url_attribute => :slug
25
33
 
26
34
  has_one :profile, :dependent => :destroy
@@ -67,7 +75,7 @@ class Actor < ActiveRecord::Base
67
75
  end
68
76
  }
69
77
 
70
- scope :search, lambda { |param|
78
+ scope :name_search, lambda { |param|
71
79
  if param.present?
72
80
  where('actors.name LIKE ?', "%#{ param }%")
73
81
  end
@@ -63,11 +63,11 @@ class Contact < ActiveRecord::Base
63
63
  after_save :send_message
64
64
 
65
65
  def sender_subject
66
- sender.try(:subject)
66
+ sender.subject
67
67
  end
68
68
 
69
69
  def receiver_subject
70
- receiver.try(:subject)
70
+ receiver.subject
71
71
  end
72
72
 
73
73
  # Does this {Contact} have the same sender and receiver?
data/app/models/post.rb CHANGED
@@ -2,4 +2,11 @@ class Post < ActiveRecord::Base
2
2
  include SocialStream::Models::Object
3
3
 
4
4
  validates_presence_of :text
5
+
6
+ define_index do
7
+ indexes text
8
+
9
+ has created_at
10
+ end
11
+
5
12
  end
@@ -0,0 +1,68 @@
1
+ <% toolbar :profile => current_subject %>
2
+
3
+ <%= location(image_tag("btn/btn_account.png", :class => "menu_icon")+t('account.one'),
4
+ link_to (t('account.edit'), edit_user_registration_path)
5
+ ) %>
6
+
7
+ <div class="space_center"></div>
8
+
9
+ <div class="block" id="account_form">
10
+ <div class="form_row">
11
+ <h2><%= t('account.edit') %></h2>
12
+ </div>
13
+
14
+ <%= form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
15
+ <%= devise_error_messages! %>
16
+
17
+ <div class="form_row">
18
+ <div class="form_label">
19
+ <%= f.label :email %>
20
+ </div>
21
+ <div class="form_field">
22
+ <%= f.email_field :email, :class => "form_tag" %>
23
+ </div>
24
+ </div>
25
+ <div class="form_row">
26
+ <div class="form_label">
27
+ <%= f.label :password %>
28
+ </div>
29
+ <div class="form_field">
30
+ <%= f.password_field :password, :class => "form_tag" %><br/>
31
+ <span class="form_comment">(Leave blank if you don't want to change it)</span>
32
+ </div>
33
+ </div>
34
+ <div class="form_row">
35
+ <div class="form_label">
36
+ <%= f.label :password_confirmation %>
37
+ </div>
38
+ <div class="form_field">
39
+ <%= f.password_field :password_confirmation, :class => "form_tag" %>
40
+ </div>
41
+ </div>
42
+ <div class="form_row">
43
+ <div class="form_label">
44
+ <%= f.label :current_password %>
45
+ </div>
46
+ <div class="form_field">
47
+ <%= f.password_field :current_password, :class => "form_tag" %><br/>
48
+ <span class="form_comment">(We need your current password to confirm your changes)</span>
49
+ </div>
50
+ </div>
51
+ <div class="form_row space_center">
52
+ <%= f.submit t('button.update'), :class => "button" %>
53
+ <button class="button" onclick="window.location.href='<%= polymorphic_path(current_subject) %>';">
54
+ <%= t('button.cancel')%>
55
+ </button>
56
+ </div>
57
+ <% end %>
58
+ <div>
59
+ <div class="block">
60
+ <div class="content">
61
+ <h3>Cancel my account</h3>
62
+ </div>
63
+
64
+ <p>Unhappy? <%= link_to "Cancel my account", registration_path(resource_name), :confirm => "Are you sure?", :method => :delete %>.</p>
65
+
66
+ <%= link_to "Back", :back %>
67
+
68
+ </div>
@@ -7,8 +7,6 @@
7
7
  <% if user_signed_in? %>
8
8
  <div class="menu_list menu_white" id="menu_home">
9
9
  <ul>
10
- <li class="btn_menu_home"><%= link_to t('home'), home_path %></li>
11
- <li class="pipe">|</li>
12
10
  <li class="btn_menu_profile"><%= link_to(t('profile.one'), current_subject)%></li>
13
11
  <li class="pipe">|</li>
14
12
  <li class="btn_menu_browse"><%=link_to(t('browse'),users_path) %></li>
@@ -35,6 +35,8 @@ require 'resque/server'
35
35
  require 'simple-navigation'
36
36
  # Modernizr.js library
37
37
  require 'modernizr-rails'
38
+ # Sphinx search engine
39
+ require 'thinking-sphinx'
38
40
 
39
41
  # Provides your Rails application with social network and activity stream support
40
42
  module SocialStream
@@ -1,5 +1,5 @@
1
1
  module SocialStream
2
2
  module Base
3
- VERSION = "0.8.0".freeze
3
+ VERSION = "0.8.1".freeze
4
4
  end
5
5
  end
@@ -16,7 +16,7 @@ module SocialStream
16
16
  # There are several scopes available for subjects
17
17
  #
18
18
  # alphabetic:: sort subjects by name
19
- # search:: simple search by name
19
+ # name_search:: simple search by name
20
20
  # distinct_initials:: get only the first letter of the name
21
21
  # followed:: sort by most following incoming {Tie ties}
22
22
  # liked:: sort by most likes
@@ -27,7 +27,8 @@ module SocialStream
27
27
  included do
28
28
  belongs_to :actor,
29
29
  :validate => true,
30
- :autosave => true
30
+ :autosave => true,
31
+ :dependent => :destroy
31
32
 
32
33
  has_one :profile, :through => :actor
33
34
 
@@ -41,8 +42,8 @@ module SocialStream
41
42
  joins(:actor).merge(Actor.letter(param))
42
43
  }
43
44
 
44
- scope :search, lambda{ |param|
45
- joins(:actor).merge(Actor.search(param))
45
+ scope :name_search, lambda{ |param|
46
+ joins(:actor).merge(Actor.name_search(param))
46
47
  }
47
48
 
48
49
  scope :tagged_with, lambda { |param|
@@ -37,7 +37,7 @@ Gem::Specification.new do |s|
37
37
  # OAuth provider
38
38
  s.add_runtime_dependency('oauth-plugin','~> 0.4.0.pre1')
39
39
  # Messages
40
- s.add_runtime_dependency('mailboxer','~> 0.5.0')
40
+ s.add_runtime_dependency('mailboxer','~> 0.5.3')
41
41
  # Tagging
42
42
  s.add_runtime_dependency('acts-as-taggable-on','~> 2.0.6')
43
43
  # HTML Forms
@@ -48,6 +48,8 @@ Gem::Specification.new do |s|
48
48
  s.add_runtime_dependency('resque','~> 1.17.1')
49
49
  # Modernizr.js javascript library
50
50
  s.add_runtime_dependency('modernizr-rails', '~> 2.0.6')
51
+ # Sphinx search engine
52
+ s.add_runtime_dependency('thinking-sphinx', '~> 2.0.7')
51
53
 
52
54
  # Development gem dependencies
53
55
  #
@@ -25,4 +25,27 @@ describe Actor do
25
25
  a.pending_contacts.should_not include(c)
26
26
  end
27
27
  end
28
+
29
+ it 'should generate suggestion' do
30
+ 10.times do
31
+ Factory(:user)
32
+ end
33
+
34
+ sgs = Factory(:user).suggestions(5)
35
+
36
+ sgs.size.should be(5)
37
+
38
+ sgs_names = sgs.map{ |s| s.receiver_subject.name }.compact
39
+
40
+ sgs.size.should be(5)
41
+ end
42
+
43
+ it "should be destroyed" do
44
+ u = Factory(:user)
45
+ a = u.actor
46
+
47
+ u.destroy
48
+
49
+ Actor.find_by_id(a.id).should be_nil
50
+ end
28
51
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: social_stream-base
3
3
  version: !ruby/object:Gem::Version
4
- hash: 63
4
+ hash: 61
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 8
9
- - 0
10
- version: 0.8.0
9
+ - 1
10
+ version: 0.8.1
11
11
  platform: ruby
12
12
  authors:
13
13
  - GING - DIT - UPM
@@ -16,7 +16,7 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2011-09-06 00:00:00 +02:00
19
+ date: 2011-09-07 00:00:00 +02:00
20
20
  default_executable:
21
21
  dependencies:
22
22
  - !ruby/object:Gem::Dependency
@@ -221,12 +221,12 @@ dependencies:
221
221
  requirements:
222
222
  - - ~>
223
223
  - !ruby/object:Gem::Version
224
- hash: 11
224
+ hash: 13
225
225
  segments:
226
226
  - 0
227
227
  - 5
228
- - 0
229
- version: 0.5.0
228
+ - 3
229
+ version: 0.5.3
230
230
  type: :runtime
231
231
  version_requirements: *id013
232
232
  - !ruby/object:Gem::Dependency
@@ -308,9 +308,25 @@ dependencies:
308
308
  type: :runtime
309
309
  version_requirements: *id018
310
310
  - !ruby/object:Gem::Dependency
311
- name: capybara
311
+ name: thinking-sphinx
312
312
  prerelease: false
313
313
  requirement: &id019 !ruby/object:Gem::Requirement
314
+ none: false
315
+ requirements:
316
+ - - ~>
317
+ - !ruby/object:Gem::Version
318
+ hash: 1
319
+ segments:
320
+ - 2
321
+ - 0
322
+ - 7
323
+ version: 2.0.7
324
+ type: :runtime
325
+ version_requirements: *id019
326
+ - !ruby/object:Gem::Dependency
327
+ name: capybara
328
+ prerelease: false
329
+ requirement: &id020 !ruby/object:Gem::Requirement
314
330
  none: false
315
331
  requirements:
316
332
  - - ~>
@@ -322,11 +338,11 @@ dependencies:
322
338
  - 9
323
339
  version: 0.3.9
324
340
  type: :development
325
- version_requirements: *id019
341
+ version_requirements: *id020
326
342
  - !ruby/object:Gem::Dependency
327
343
  name: sqlite3-ruby
328
344
  prerelease: false
329
- requirement: &id020 !ruby/object:Gem::Requirement
345
+ requirement: &id021 !ruby/object:Gem::Requirement
330
346
  none: false
331
347
  requirements:
332
348
  - - ">="
@@ -336,11 +352,11 @@ dependencies:
336
352
  - 0
337
353
  version: "0"
338
354
  type: :development
339
- version_requirements: *id020
355
+ version_requirements: *id021
340
356
  - !ruby/object:Gem::Dependency
341
357
  name: ruby-debug
342
358
  prerelease: false
343
- requirement: &id021 !ruby/object:Gem::Requirement
359
+ requirement: &id022 !ruby/object:Gem::Requirement
344
360
  none: false
345
361
  requirements:
346
362
  - - ">="
@@ -350,11 +366,11 @@ dependencies:
350
366
  - 0
351
367
  version: "0"
352
368
  type: :development
353
- version_requirements: *id021
369
+ version_requirements: *id022
354
370
  - !ruby/object:Gem::Dependency
355
371
  name: rspec-rails
356
372
  prerelease: false
357
- requirement: &id022 !ruby/object:Gem::Requirement
373
+ requirement: &id023 !ruby/object:Gem::Requirement
358
374
  none: false
359
375
  requirements:
360
376
  - - ~>
@@ -366,11 +382,11 @@ dependencies:
366
382
  - 1
367
383
  version: 2.6.1
368
384
  type: :development
369
- version_requirements: *id022
385
+ version_requirements: *id023
370
386
  - !ruby/object:Gem::Dependency
371
387
  name: factory_girl
372
388
  prerelease: false
373
- requirement: &id023 !ruby/object:Gem::Requirement
389
+ requirement: &id024 !ruby/object:Gem::Requirement
374
390
  none: false
375
391
  requirements:
376
392
  - - ~>
@@ -382,11 +398,11 @@ dependencies:
382
398
  - 2
383
399
  version: 1.3.2
384
400
  type: :development
385
- version_requirements: *id023
401
+ version_requirements: *id024
386
402
  - !ruby/object:Gem::Dependency
387
403
  name: forgery
388
404
  prerelease: false
389
- requirement: &id024 !ruby/object:Gem::Requirement
405
+ requirement: &id025 !ruby/object:Gem::Requirement
390
406
  none: false
391
407
  requirements:
392
408
  - - ~>
@@ -398,11 +414,11 @@ dependencies:
398
414
  - 2
399
415
  version: 0.4.2
400
416
  type: :development
401
- version_requirements: *id024
417
+ version_requirements: *id025
402
418
  - !ruby/object:Gem::Dependency
403
419
  name: ci_reporter
404
420
  prerelease: false
405
- requirement: &id025 !ruby/object:Gem::Requirement
421
+ requirement: &id026 !ruby/object:Gem::Requirement
406
422
  none: false
407
423
  requirements:
408
424
  - - ~>
@@ -414,11 +430,11 @@ dependencies:
414
430
  - 4
415
431
  version: 1.6.4
416
432
  type: :development
417
- version_requirements: *id025
433
+ version_requirements: *id026
418
434
  - !ruby/object:Gem::Dependency
419
435
  name: nifty-generators
420
436
  prerelease: false
421
- requirement: &id026 !ruby/object:Gem::Requirement
437
+ requirement: &id027 !ruby/object:Gem::Requirement
422
438
  none: false
423
439
  requirements:
424
440
  - - ~>
@@ -430,7 +446,7 @@ dependencies:
430
446
  - 5
431
447
  version: 0.4.5
432
448
  type: :development
433
- version_requirements: *id026
449
+ version_requirements: *id027
434
450
  description: |-
435
451
  Social Stream is a Ruby on Rails engine providing your application with social networking features and activity streams.
436
452
 
@@ -598,6 +614,7 @@ files:
598
614
  - app/assets/javascripts/posts.js
599
615
  - app/assets/javascripts/profiles.js
600
616
  - app/assets/javascripts/relation_customs.js
617
+ - app/assets/javascripts/search.js
601
618
  - app/assets/javascripts/settings.js
602
619
  - app/assets/javascripts/social_stream-base.js
603
620
  - app/assets/javascripts/ties.js
@@ -738,6 +755,7 @@ files:
738
755
  - app/views/conversations/show.js.erb
739
756
  - app/views/devise/passwords/edit.html.erb
740
757
  - app/views/devise/passwords/new.html.erb
758
+ - app/views/devise/registrations/edit.html.erb
741
759
  - app/views/devise/registrations/new.html.erb
742
760
  - app/views/devise/sessions/new.html.erb
743
761
  - app/views/frontpage/_header.html.erb