popular posts: add pagination.
This commit is contained in:
@@ -6,7 +6,7 @@ module Explore
|
|||||||
@date, @scale, @min_date, @max_date = parse_date(params)
|
@date, @scale, @min_date, @max_date = parse_date(params)
|
||||||
|
|
||||||
limit = params.fetch(:limit, CurrentUser.user.per_page)
|
limit = params.fetch(:limit, CurrentUser.user.per_page)
|
||||||
@posts = popular_posts(@min_date, @max_date).paginate(params[:page], limit: limit)
|
@posts = popular_posts(@min_date, @max_date).paginate(params[:page], limit: limit, search_count: false)
|
||||||
|
|
||||||
respond_with(@posts)
|
respond_with(@posts)
|
||||||
end
|
end
|
||||||
@@ -15,7 +15,7 @@ module Explore
|
|||||||
@date, @scale, @min_date, @max_date = parse_date(params)
|
@date, @scale, @min_date, @max_date = parse_date(params)
|
||||||
|
|
||||||
limit = params.fetch(:limit, CurrentUser.user.per_page)
|
limit = params.fetch(:limit, CurrentUser.user.per_page)
|
||||||
@posts = curated_posts(@min_date, @max_date).paginate(params[:page], limit: limit)
|
@posts = curated_posts(@min_date, @max_date).paginate(params[:page], limit: limit, search_count: false)
|
||||||
|
|
||||||
respond_with(@posts)
|
respond_with(@posts)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,5 +11,6 @@
|
|||||||
<%= render "posts/partials/common/inline_blacklist" %>
|
<%= render "posts/partials/common/inline_blacklist" %>
|
||||||
|
|
||||||
<%= post_previews_html(@posts) %>
|
<%= post_previews_html(@posts) %>
|
||||||
|
<%= numbered_paginator(@posts) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -11,5 +11,6 @@
|
|||||||
<%= render "posts/partials/common/inline_blacklist" %>
|
<%= render "posts/partials/common/inline_blacklist" %>
|
||||||
|
|
||||||
<%= post_previews_html(@posts) %>
|
<%= post_previews_html(@posts) %>
|
||||||
|
<%= numbered_paginator(@posts) %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user