Skip to content
Extraits de code Groupes Projets
Valider d04cf704 rédigé par Steffen van Bergerem's avatar Steffen van Bergerem
Parcourir les fichiers

Fix pagination for people/guid/contacts

parent 803c257e
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -119,4 +119,6 @@ ...@@ -119,4 +119,6 @@
} }
} }
.stream_container > .pagination { text-align: center; }
} }
...@@ -149,7 +149,6 @@ class PeopleController < ApplicationController ...@@ -149,7 +149,6 @@ class PeopleController < ApplicationController
if @person if @person
@contact = current_user.contact_for(@person) @contact = current_user.contact_for(@person)
@contacts_of_contact = Contact.contact_contacts_for(current_user, @person) @contacts_of_contact = Contact.contact_contacts_for(current_user, @person)
@hashes = hashes_for_people @contacts_of_contact, @aspects
gon.preloads[:person] = PersonPresenter.new(@person, current_user).full_hash_with_profile gon.preloads[:person] = PersonPresenter.new(@person, current_user).full_hash_with_profile
gon.preloads[:photos] = { gon.preloads[:photos] = {
count: photos_from(@person).count(:all), count: photos_from(@person).count(:all),
...@@ -158,6 +157,7 @@ class PeopleController < ApplicationController ...@@ -158,6 +157,7 @@ class PeopleController < ApplicationController
count: @contacts_of_contact.count(:all), count: @contacts_of_contact.count(:all),
} }
@contacts_of_contact = @contacts_of_contact.paginate(:page => params[:page], :per_page => (params[:limit] || 15)) @contacts_of_contact = @contacts_of_contact.paginate(:page => params[:page], :per_page => (params[:limit] || 15))
@hashes = hashes_for_people @contacts_of_contact, @aspects
respond_with @person respond_with @person
else else
flash[:error] = I18n.t 'people.show.does_not_exist' flash[:error] = I18n.t 'people.show.does_not_exist'
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
#people_stream.stream #people_stream.stream
- @hashes.each do |hash| - @hashes.each do |hash|
= render :partial => 'people/person', :locals => hash = render :partial => 'people/person', :locals => hash
= will_paginate @contacts_of_contact = will_paginate @contacts_of_contact, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer
%a{:id=>"back-to-top", :title=>"#{t('layouts.application.back_to_top')}", :href=>"#"} %a{:id=>"back-to-top", :title=>"#{t('layouts.application.back_to_top')}", :href=>"#"}
&#8679; &#8679;
......
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