Skip to content
Extraits de code Groupes Projets
Valider 3a180448 rédigé par Raphael Sofaer's avatar Raphael Sofaer
Parcourir les fichiers

Fix infinite scroll on search... some kind of weird thing with rails...

Fix infinite scroll on search... some kind of weird thing with rails responding with json even when request.format is html, with a mime type of html
parent f60ce932
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -30,7 +30,18 @@ class PeopleController < ApplicationController ...@@ -30,7 +30,18 @@ class PeopleController < ApplicationController
render :json => @people render :json => @people
end end
format.all do format.html do
#only do it if it is an email address
if params[:q].try(:match, Devise.email_regexp)
people = Person.where(:diaspora_handle => params[:q])
webfinger(params[:q]) if people.empty?
else
people = Person.search(params[:q], current_user)
end
@people = people.paginate( :page => params[:page], :per_page => 15)
@hashes = hashes_for_people(@people, @aspects)
end
format.mobile do
#only do it if it is an email address #only do it if it is an email address
if params[:q].try(:match, Devise.email_regexp) if params[:q].try(:match, Devise.email_regexp)
people = Person.where(:diaspora_handle => params[:q]) people = Person.where(:diaspora_handle => params[:q])
...@@ -68,7 +79,7 @@ class PeopleController < ApplicationController ...@@ -68,7 +79,7 @@ class PeopleController < ApplicationController
@person = Person.find_from_id_or_username(params) @person = Person.find_from_id_or_username(params)
if remote_profile_with_no_user_session? if remote_profile_with_no_user_session?
raise ActiveRecord::RecordNotFound raise ActiveRecord::RecordNotFound
end end
@post_type = :all @post_type = :all
......
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