From 01e9020b6a74e9ae556b39192e950c229bad4eb3 Mon Sep 17 00:00:00 2001 From: evazion Date: Sun, 23 Feb 2020 17:25:37 -0600 Subject: [PATCH] popular posts: add pagination. --- app/controllers/explore/posts_controller.rb | 4 ++-- app/views/explore/posts/curated.html.erb | 1 + app/views/explore/posts/popular.html.erb | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/explore/posts_controller.rb b/app/controllers/explore/posts_controller.rb index baf67ebad..89101f98d 100644 --- a/app/controllers/explore/posts_controller.rb +++ b/app/controllers/explore/posts_controller.rb @@ -6,7 +6,7 @@ module Explore @date, @scale, @min_date, @max_date = parse_date(params) 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) end @@ -15,7 +15,7 @@ module Explore @date, @scale, @min_date, @max_date = parse_date(params) 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) end diff --git a/app/views/explore/posts/curated.html.erb b/app/views/explore/posts/curated.html.erb index 618e1ffbe..2cf1bd0e4 100644 --- a/app/views/explore/posts/curated.html.erb +++ b/app/views/explore/posts/curated.html.erb @@ -11,5 +11,6 @@ <%= render "posts/partials/common/inline_blacklist" %> <%= post_previews_html(@posts) %> + <%= numbered_paginator(@posts) %> diff --git a/app/views/explore/posts/popular.html.erb b/app/views/explore/posts/popular.html.erb index e6efc8010..69534403d 100644 --- a/app/views/explore/posts/popular.html.erb +++ b/app/views/explore/posts/popular.html.erb @@ -11,5 +11,6 @@ <%= render "posts/partials/common/inline_blacklist" %> <%= post_previews_html(@posts) %> + <%= numbered_paginator(@posts) %>