Skip to content
Extraits de code Groupes Projets
Valider 7048fa6d rédigé par Steven Fuchs's avatar Steven Fuchs
Parcourir les fichiers

fixing conflicts in merge

parent 8344422a
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -46,15 +46,16 @@ class PeopleController < ApplicationController
def refresh_search
@aspect = :search
@people = Person.where(:diaspora_handle => search_query.downcase)
@people = @people.paginate(:page => params[:page], :per_page => 15)
@hashes = hashes_for_people(@people, @aspects)
@answer_html = ""
unless @people.empty?
@people = @people.paginate(:page => params[:page], :per_page => 15)
@hashes = hashes_for_people(@people, @aspects)
self.formats = self.formats + [:html]
@hashes.each do |hash|
@answer_html += render_to_string :partial => 'people/person', :locals => hash
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" : "" }
=t('.searching')
- if ! @background_query.nil?
- if @background_query.present?
%p
=t('.searching')
: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
......
......@@ -29,8 +29,8 @@ en:
my_stream: "Stream"
videos:
watch: "Watch this video on <%= provider %>"
unknown: "Unknown video type"
watch: "Watch this video on <%= provider %>"
unknown: "Unknown video type"
search_for: "Search for <%= name %>"
publisher:
at_least_one_aspect: "You must publish to at least one aspect"
......@@ -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>" );
}
}
\ No newline at end of file
# 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
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter