fixing conflicts in merge
This commit is contained in:
parent
8344422aef
commit
7048fa6d50
6 changed files with 36 additions and 16 deletions
|
|
@ -46,15 +46,16 @@ class PeopleController < ApplicationController
|
|||
def refresh_search
|
||||
@aspect = :search
|
||||
@people = Person.where(:diaspora_handle => search_query.downcase)
|
||||
@answer_html = ""
|
||||
unless @people.empty?
|
||||
@people = @people.paginate(:page => params[:page], :per_page => 15)
|
||||
@hashes = hashes_for_people(@people, @aspects)
|
||||
@answer_html = ""
|
||||
|
||||
self.formats = self.formats + [:html]
|
||||
@hashes.each do |hash|
|
||||
@answer_html += render_to_string :partial => 'people/person', :locals => hash
|
||||
end
|
||||
|
||||
end
|
||||
render :json => { :search_count => @people.count, :search_html => @answer_html }.to_json
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -18,13 +18,14 @@
|
|||
.span-15.append-1
|
||||
#people_stream.stream
|
||||
- if @hashes.empty?
|
||||
%p#not_found{:class => @background_query.nil? ? "" : "hidden" }
|
||||
=t('.no_one_found')
|
||||
%p#searching{:class => @background_query.nil? ? "hidden" : "" }
|
||||
- if @background_query.present?
|
||||
%p
|
||||
=t('.searching')
|
||||
- if ! @background_query.nil?
|
||||
:javascript
|
||||
$(document).ready(function() { setTimeout("runDelayedSearch('#{@background_query}')", 10000); });
|
||||
- else
|
||||
%p
|
||||
=t('.no_one_found')
|
||||
- else
|
||||
- for hash in @hashes
|
||||
= render :partial => 'people/person', :locals => hash
|
||||
|
|
|
|||
|
|
@ -73,6 +73,8 @@ en:
|
|||
looking_good: "OMG, you look awesome!"
|
||||
tags:
|
||||
wasnt_that_interesting: "OK, I suppose #<%= tagName %> wasn't all that interesting..."
|
||||
people:
|
||||
not_found: "and no one was found..."
|
||||
|
||||
stream:
|
||||
hide: "Hide"
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ function handleSearchRefresh(data) {
|
|||
if ( data.search_count > 0 ) {
|
||||
$("#people_stream.stream").html( data.search_html );
|
||||
} else {
|
||||
$("p#not_found").removeClass( 'hidden' );
|
||||
$("p#searching").addClass( 'hidden' );
|
||||
$("#people_stream.stream").html( "<p>" + Diaspora.I18n.t("people.not_found") + "</p>" );
|
||||
}
|
||||
}
|
||||
18
spec/controllers/jasmine_fixtures/people.spec.rb
Normal file
18
spec/controllers/jasmine_fixtures/people.spec.rb
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
# Copyright (c) 2010-2011, Diaspora Inc. This file is
|
||||
# licensed under the Affero General Public License version 3 or later. See
|
||||
# the COPYRIGHT file.
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe PeopleController do
|
||||
describe '#index' do
|
||||
before do
|
||||
sign_in :user, bob
|
||||
end
|
||||
|
||||
it "generates a jasmine fixture", :fixture => true do
|
||||
get :index
|
||||
save_fixture(html_for("body"), "empty_people_search")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
@ -373,7 +373,6 @@ describe PeopleController do
|
|||
end
|
||||
it 'returns with a found name' do
|
||||
get :refresh_search, :q => @korth.diaspora_handle
|
||||
puts JSON.parse( response.body ).inspect
|
||||
JSON.parse( response.body )["search_count"].should == 1
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in a new issue