move pool search to index (#636)

This commit is contained in:
Toks
2013-04-23 15:20:09 -04:00
parent 8b56fd7ae7
commit 3c88053c42
5 changed files with 46 additions and 26 deletions

View File

@@ -0,0 +1,45 @@
<table class="search">
<tbody>
<%= form_tag pools_path, :method => :get, :class => "simple_form" do %>
<tr>
<th><label for="search_name_matches">Name</label></th>
<td>
<div class="input">
<%= text_field "search", "name_matches" %>
</div>
</td>
</tr>
<tr>
<th><label for="search_description_matches">Description</label></th>
<td>
<div class="input">
<%= text_field "search", "description_matches" %>
</div>
</td>
</tr>
<tr>
<th><label for="search_creator_name">Creator</th>
<td>
<div class="input">
<%= text_field "search", "creator_name" %>
</div>
</td>
</tr>
<tr>
<th><label for="search_sort">Order</th>
<td>
<div class="input">
<%= select "search", "sort", [["Last updated", "updated_at"], ["Name", "name"]] %>
</div>
</td>
</tr>
<tr>
<td><%= submit_tag "Search" %></td>
</tr>
<% end %>
</tbody>
</table>

View File

@@ -2,7 +2,6 @@
<menu>
<li><%= render "pools/quick_search" %></li>
<li><%= link_to "Listing", pools_path %></li>
<li><%= link_to "Search", search_pools_path %></li>
<li><%= link_to "New", new_pool_path %></li>
<% if CurrentUser.is_member? && @pool && !@pool.new_record? %>
<li>|</li>

View File

@@ -1,5 +1,6 @@
<div id="c-pools">
<div id="a-index">
<%= render "search" %>
<table class="striped" width="100%">
<thead>
<tr>

View File

@@ -1,22 +0,0 @@
<div id="c-pools">
<div id="a-search">
<%= form_tag pools_path, :method => :get, :class => "simple_form" do %>
<%= search_field "name_matches", :label => "Name" %>
<%= search_field "description_matches", :label => "Description" %>
<%= search_field "creator_name", :label => "Creator" %>
<div class="input">
<label>Order</label>
<%= select "search", "sort", [["Last updated", "updated_at"], ["Name", "name"]] %>
</div>
<%= submit_tag "Search" %>
<% end %>
</div>
</div>
<%= render "secondary_links" %>
<% content_for(:page_title) do %>
Search Pools - <%= Danbooru.config.app_name %>
<% end %>

View File

@@ -122,9 +122,6 @@ Danbooru::Application.routes.draw do
end
resources :note_versions, :only => [:index]
resources :pools do
collection do
get :search
end
member do
put :revert
post :undelete