Merge branch 'master' of github.com:diaspora/diaspora
This commit is contained in:
commit
ec41ace9bf
8 changed files with 20 additions and 34 deletions
3
Gemfile
3
Gemfile
|
|
@ -14,7 +14,8 @@ gem 'devise_invitable','0.3.5'
|
|||
|
||||
#Authentication
|
||||
gem 'omniauth'
|
||||
gem 'twitter'
|
||||
gem 'twitter', '0.9.12'
|
||||
|
||||
#Mongo
|
||||
gem 'mongo_mapper', :branch => 'rails3', :git => 'git://github.com/jnunemaker/mongomapper.git'
|
||||
gem 'bson_ext', '1.1'
|
||||
|
|
|
|||
18
Gemfile.lock
18
Gemfile.lock
|
|
@ -176,8 +176,6 @@ GEM
|
|||
addressable (~> 2.2.2)
|
||||
multipart-post (~> 1.0.1)
|
||||
rack (>= 1.1.0, < 2)
|
||||
faraday_middleware (0.3.0)
|
||||
faraday (~> 0.5.3)
|
||||
fastercsv (1.5.3)
|
||||
fastthread (1.0.7)
|
||||
ffi (0.6.3)
|
||||
|
|
@ -190,6 +188,8 @@ GEM
|
|||
hashie (0.4.0)
|
||||
highline (1.6.1)
|
||||
http_connection (1.4.0)
|
||||
httparty (0.6.1)
|
||||
crack (= 0.1.8)
|
||||
i18n (0.4.2)
|
||||
jammit (0.5.4)
|
||||
closure-compiler (>= 0.1.0)
|
||||
|
|
@ -224,7 +224,6 @@ GEM
|
|||
fastthread (>= 1.0.1)
|
||||
gem_plugin (>= 0.2.3)
|
||||
multi_json (0.0.5)
|
||||
multi_xml (0.2.0)
|
||||
multipart-post (1.0.1)
|
||||
net-ldap (0.1.1)
|
||||
nokogiri (1.4.3.1)
|
||||
|
|
@ -328,7 +327,6 @@ GEM
|
|||
ffi (~> 0.6.3)
|
||||
json_pure
|
||||
rubyzip
|
||||
simple_oauth (0.1.2)
|
||||
subexec (0.0.4)
|
||||
systemu (1.2.0)
|
||||
term-ansicolor (1.0.5)
|
||||
|
|
@ -339,13 +337,11 @@ GEM
|
|||
thor (0.14.6)
|
||||
treetop (1.4.9)
|
||||
polyglot (>= 0.3.1)
|
||||
twitter (1.0.0)
|
||||
faraday (~> 0.5.3)
|
||||
faraday_middleware (~> 0.3.0)
|
||||
twitter (0.9.12)
|
||||
hashie (~> 0.4.0)
|
||||
multi_json (~> 0.0.5)
|
||||
multi_xml (~> 0.2.0)
|
||||
simple_oauth (~> 0.1.2)
|
||||
httparty (~> 0.6.1)
|
||||
multi_json (~> 0.0.4)
|
||||
oauth (~> 0.4.3)
|
||||
tzinfo (0.3.23)
|
||||
uuidtools (2.1.1)
|
||||
warden (0.10.7)
|
||||
|
|
@ -400,6 +396,6 @@ DEPENDENCIES
|
|||
rspec-rails (>= 2.0.0)
|
||||
ruby-debug
|
||||
thin
|
||||
twitter
|
||||
twitter (= 0.9.12)
|
||||
webmock
|
||||
will_paginate (= 3.0.pre2)
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class Person
|
|||
attr_accessible :profile
|
||||
|
||||
def self.search(query)
|
||||
return Person.searchable.all if query.to_s.empty?
|
||||
return [] if query.to_s.empty?
|
||||
query_tokens = query.to_s.strip.split(" ")
|
||||
full_query_text = Regexp.escape(query.to_s.strip)
|
||||
|
||||
|
|
@ -58,9 +58,9 @@ class Person
|
|||
|
||||
query_tokens.each do |token|
|
||||
q = Regexp.escape(token.to_s.strip)
|
||||
p = Person.searchable.all('profile.first_name' => /^#{q}/i) \
|
||||
| Person.searchable.all('profile.last_name' => /^#{q}/i) \
|
||||
| Person.searchable.all('diaspora_handle' => /^#{q}/i) \
|
||||
p = Person.searchable.all('profile.first_name' => /^#{q}/i, 'limit' => 30) \
|
||||
| Person.searchable.all('profile.last_name' => /^#{q}/i, 'limit' => 30) \
|
||||
| Person.searchable.all('diaspora_handle' => /^#{q}/i, 'limit' => 30) \
|
||||
| p
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -2,15 +2,6 @@
|
|||
-# licensed under the Affero General Public License version 3 or later. See
|
||||
-# the COPYRIGHT file.
|
||||
|
||||
|
||||
=content_for(:head) do
|
||||
:javascript
|
||||
$(document).ready(function(){
|
||||
$(".image_thumb img").load( function() {
|
||||
$(this).fadeIn("slow");
|
||||
});
|
||||
});
|
||||
|
||||
.span-15.last
|
||||
#thumbnails
|
||||
- for photo in photos
|
||||
|
|
|
|||
|
|
@ -27,10 +27,6 @@ $(document).ready(function(){
|
|||
|
||||
$("input[type='submit']").addClass("button");
|
||||
|
||||
$(".image_cycle img").load( function() {
|
||||
$(this).fadeIn("slow");
|
||||
});
|
||||
|
||||
$("#q").focus(
|
||||
function() {
|
||||
$(this).addClass('active');
|
||||
|
|
|
|||
|
|
@ -1009,7 +1009,6 @@ h1.big_text
|
|||
:min-height 100px
|
||||
|
||||
img
|
||||
:display none
|
||||
:height 100px
|
||||
:width 100px
|
||||
|
||||
|
|
|
|||
|
|
@ -28,18 +28,16 @@ describe PeopleController do
|
|||
it 'shows a contact' do
|
||||
user2 = make_user
|
||||
connect_users(user, aspect, user2, user2.aspects.create(:name => 'Neuroscience'))
|
||||
get :index
|
||||
get :index, :q => user2.person.profile.first_name.to_s
|
||||
assigns[:people].should include user2.person
|
||||
response.should be_success
|
||||
end
|
||||
|
||||
it 'shows a non-contact' do
|
||||
user2 = make_user
|
||||
user2.person.profile.searchable = true
|
||||
user2.save
|
||||
get :index
|
||||
get :index, :q => user2.person.profile.first_name.to_s
|
||||
assigns[:people].should include user2.person
|
||||
response.should be_success
|
||||
end
|
||||
|
||||
it "redirects to person page if there is exactly one match" do
|
||||
|
|
|
|||
|
|
@ -164,6 +164,11 @@ describe Person do
|
|||
@connected_person_four.save
|
||||
end
|
||||
|
||||
it 'should return nothing on an emprty query' do
|
||||
people = Person.search("")
|
||||
people.empty?.should be true
|
||||
end
|
||||
|
||||
it 'should yield search results on partial names' do
|
||||
people = Person.search("Eu")
|
||||
people.include?(@connected_person_two).should == true
|
||||
|
|
|
|||
Loading…
Reference in a new issue