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:
@@ -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
|
||||
|
||||
|
||||
@@ -37,22 +37,20 @@
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<% if path != gallery_pools_path %>
|
||||
<tr>
|
||||
<th><label for="search_category">Category</th>
|
||||
<td>
|
||||
<div class="input">
|
||||
<%= select "search", "category", [["Series", "series"], ["Collection", "collection"]], :selected => params[:search][:category], :include_blank => true %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th><label for="search_category">Category</th>
|
||||
<td>
|
||||
<div class="input">
|
||||
<%= select "search", "category", [["Series", "series"], ["Collection", "collection"]], :selected => params[:search][:category], :include_blank => true %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th><label for="search_order">Order</th>
|
||||
<td>
|
||||
<div class="input">
|
||||
<%= select "search", "order", [["Last updated", "updated_at"], ["Name", "name"], ["Recently created", "created_at"], ["Post count", "post_count"]], :selected => params[:search][:order] %>
|
||||
<%= select "search", "order", [["Last updated", "updated_at"], ["Name", "name"], ["Recently created", "created_at"], ["Post count", "post_count"]], :selected => params[:search][:order], :include_blank => true %>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
Reference in New Issue
Block a user