Allow searching for deleted pools

This commit is contained in:
Toks
2013-11-01 10:07:47 -04:00
parent 7b53999566
commit 2bc5605edc
3 changed files with 10 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ class PoolsController < ApplicationController
end
def index
@pools = Pool.undeleted.search(params[:search]).order("updated_at desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
@pools = Pool.search(params[:search]).order("updated_at desc").paginate(params[:page], :limit => params[:limit], :search_count => params[:search])
respond_with(@pools) do |format|
format.xml do
render :xml => @pools.to_xml(:root => "pools")

View File

@@ -84,6 +84,12 @@ class Pool < ActiveRecord::Base
q = q.collection
end
if params[:is_deleted] == "true"
q = q.deleted
else
q = q.undeleted
end
q
end
end

View File

@@ -17,6 +17,9 @@
</td>
<td>
<%= link_to pool.pretty_name, pool_path(pool) %>
<% if pool.is_deleted? %>
<span class="inactive">(deleted)</span>
<% end %>
<% if pool.post_count > CurrentUser.user.per_page %>
<%= link_to "page #{pool.last_page}", pool_path(pool, :page => pool.last_page), :class => "last-page" %>