pools/gallery: allow searching for collection pools (#3992).

Default to showing only series pools when not doing a search. Otherwise,
when doing a search, show both series and collection pools.
This commit is contained in:
evazion
2018-11-15 11:38:35 -06:00
parent 4fcb82f2e6
commit 29fdfc42a4
2 changed files with 13 additions and 13 deletions

View File

@@ -30,8 +30,10 @@ class PoolsController < ApplicationController
end
def gallery
limit = params[:limit] || CurrentUser.user.per_page
@pools = Pool.series.search(search_params).reorder("updated_at desc").paginate(params[:page], :limit => limit, :search_count => params[:search])
params[:limit] ||= CurrentUser.user.per_page
search = search_params.presence || ActionController::Parameters.new(category: "series")
@pools = Pool.search(search).paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
@post_set = PostSets::PoolGallery.new(@pools)
end