Skip to content
Snippets Groups Projects
Commit 5abf64d6 authored by Eugen Rochko's avatar Eugen Rochko
Browse files

Add "next" pagination to public profiles

parent ec44cff9
No related branches found
No related tags found
No related merge requests found
...@@ -9,12 +9,12 @@ class AccountsController < ApplicationController ...@@ -9,12 +9,12 @@ class AccountsController < ApplicationController
def show def show
respond_to do |format| respond_to do |format|
format.html do format.html do
@statuses = @account.statuses.order('id desc').paginate_by_max_id(20, params[:max_id || nil]) @statuses = @account.statuses.order('id desc').paginate_by_max_id(20, params[:max_id], params[:since_id])
@statuses = cache_collection(@statuses, Status) @statuses = cache_collection(@statuses, Status)
end end
format.atom do format.atom do
@entries = @account.stream_entries.order('id desc').with_includes.paginate_by_max_id(20, params[:max_id] || nil) @entries = @account.stream_entries.order('id desc').with_includes.paginate_by_max_id(20, params[:max_id], params[:since_id])
end end
end end
end end
......
...@@ -14,4 +14,6 @@ ...@@ -14,4 +14,6 @@
.activity-stream .activity-stream
= render partial: 'stream_entries/status', collection: @statuses, as: :status = render partial: 'stream_entries/status', collection: @statuses, as: :status
= id_paginate account_url(@account), 20, @statuses .pagination
- if @statuses.size == 20
= link_to safe_join([t('pagination.next'), fa_icon('chevron-right')], ' '), account_url(@account, max_id: @statuses.last.id), class: 'next_page', rel: 'next'
...@@ -16,4 +16,5 @@ ...@@ -16,4 +16,5 @@
%i.fa.fa-check %i.fa.fa-check
- else - else
%i.fa.fa-times %i.fa.fa-times
= will_paginate @accounts, pagination_options = will_paginate @accounts, pagination_options
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment