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

Fix people socketing

parent 333e56b4
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -29,8 +29,8 @@ class PeopleController < ApplicationController ...@@ -29,8 +29,8 @@ class PeopleController < ApplicationController
format.all do format.all 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)
webfinger(params[:q])
people = Person.where(:diaspora_handle => params[:q]) people = Person.where(:diaspora_handle => params[:q])
webfinger(params[:q]) if people.empty?
else else
people = Person.search(params[:q], current_user) people = Person.search(params[:q], current_user)
end end
......
...@@ -20,16 +20,16 @@ ...@@ -20,16 +20,16 @@
= params[:q] = params[:q]
.span-15.append-1 .span-15.append-1
- if @hashes.empty? #people_stream.stream
%p - if @hashes.empty?
=t('.no_one_found') %p
=t('.no_one_found')
- else - else
#people_stream.stream
- for hash in @hashes - for hash in @hashes
= render :partial => 'people/person', :locals => hash = render :partial => 'people/person', :locals => hash
= will_paginate @people = will_paginate @people
.span-8.last .span-8.last
%h4 %h4
......
...@@ -54,7 +54,7 @@ var WebSocketReceiver = { ...@@ -54,7 +54,7 @@ var WebSocketReceiver = {
WebSocketReceiver.processLike(obj.post_id, obj.html); WebSocketReceiver.processLike(obj.post_id, obj.html);
} else { } else {
WebSocketReceiver.processPost(obj['class'], obj.post_id, obj.html, obj.aspect_ids); WebSocketReceiver.processPost(obj.html, obj.aspect_ids);
} }
} }
}, },
...@@ -67,7 +67,9 @@ var WebSocketReceiver = { ...@@ -67,7 +67,9 @@ var WebSocketReceiver = {
result_ul.siblings('.error').show(); result_ul.siblings('.error').show();
result_ul.find('.error').text(response.response).show(); result_ul.find('.error').text(response.response).show();
} else { } else {
$('#people_stream').prepend(response.html).slideDown('slow', function(){}); stream = $('#people_stream');
stream.find('p').remove();
stream.prepend(response.html).slideDown('slow', function(){});
var first_li = result_ul.find('li:first'); var first_li = result_ul.find('li:first');
first_li.hide(); first_li.hide();
first_li.after(response.html); first_li.after(response.html);
...@@ -131,7 +133,7 @@ var WebSocketReceiver = { ...@@ -131,7 +133,7 @@ var WebSocketReceiver = {
$('.likes', "#" + targetGUID).first().html(html); $('.likes', "#" + targetGUID).first().html(html);
}, },
processPost: function(className, postId, html, aspectIds) { processPost: function(html, aspectIds) {
if(WebSocketReceiver.onPageForAspects(aspectIds)) { if(WebSocketReceiver.onPageForAspects(aspectIds)) {
ContentUpdater.addPostToStream(html); ContentUpdater.addPostToStream(html);
} }
......
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